Format and Partition the Hard Way

The factory configuration was not very usable (one giant partition), so we need to repartition the disk and make new filesystems. Until this is done, there's no reason to do anything else, because it will all get wiped out.

This is a certainly harder than just accepting the default monolithic disk partition from the factory, or even the default "user disk" paritions (/, and /usr) which fx gives you. Unfortunately, it seems the only way of establishing a non-default partition configuration.


Disk Repartitioning and Software Installation

Some of our machines shipped with a single 2GB partion, which I wanted to carve up into more manageable partitions. Below is how I broke them down for one installation:
Function	 MB	Type	Unit	Notes

/		  25	efs	0
swap		 160	raw	1	(64MB RAM) * 2.5
/usr		 500	efs	6	all vendor SW
/var (tmp)	 125	efs	7	includes tmp
/share	       ~1300	efs	5	HOG: NFS export for local, people, etc
These numbers may not match those in the sample fx log, nor will the be right for you -- chose values appropriate to your site.

Repartition with fx

As described earlier, you can use fx to create a "user disk" which has a /, /usr and swap partitions. After selecting those defaults, leaving space of course for new partions of course, create the other partitions you want, eg: space for /var and /share.

[want some example here, or a link into the earlier example

The disk needs to be repartitioned using fx, which you can run multiuser -- until you label the disk. After approximating the proper number of MB/cylinder and a little trial-and-error, we were able to get what we wanted. The documentation is a bit weak on this procedure, so you can look at a log of the fx session. Make sure you label and sync the disk before you exit fx.

At this point the system will start complaining because it's concept of the partitions just got hosed. You need to boot from CDROM but before you can load the miniroot onto disk, you'll have to make filesystems in the new partitions.

Make / and /usr filesystems

First shutdown and reboot from the CDROM; the reboot will fail since the disk partition info is no longer accurate for the current filesystems. In Irix 5.3, select the Install Software option from the menu; and answer YES to makefs the / (root) and /usr filesystems. This will give it some place to install the software.

Install the software

Now that basic filesystems have been created, you must select and install software, as described elsewhere. After installation, rebooting should get you a functioning system. You can do most of the partition shuffling and such in multi-user mode.

Configuring and shuffling filesystems

At this point, the system has mounted the basic filesystems, / (including a default, root-based /var), and /usr. We need to mount (and switch) our /var partition and our /share partition.

First create UNIX devices which access the disk partitions you created earlier with fx, then make UNIX filesystems on them so files can be installed there. This is done with the mknod command to make devices, and mkfs to make filesystems. Be careful to associate the right device major and minor nodes, and device type (c or b) with the proper partition. Check existing entries in /dev for / and /usr for their device numbers, and compare those with the devices in /dev/dsk and /dev/rdsk. Then you will be able to determine the appropriate device nodes, SCSI disk/file names, and UNIX device names for the partitions you will be mknod-ing and mkfs-ing.

Make devices for /share

The /share partition is where we've decided to make exported files; this is where we'll really put stuff you can get to via /usr/local and /usr/people. Caution: these device names and node numbers may not be appropriate to your disk; cross-check with the partition numbers you used in fx.
# cd /dev/rdsk
# mknod dks0d1s5 c 128 21
# chmod go-rw dks0d1s1

# cd /dev/dsk
# mknod dks0d1s5 b 128 21
# chmod go-rw dks0d1s1

# cd /dev
# mknod share b 128 21
# chmod go-rw share
# mknod rshare c 128 21
# chmod go-rw rshare
No create a file system on it:
# cd /dev
# mkfs rshare
Now create a mount point:
# mkdir /share
and put an entry in /etc/fstab for the new /share partition:
/dev/share   /share  efs     rw,raw=/dev/rshare      0 0
[?? Need to document the ``0 0'' fields for fsck and dump]

Now mount it:

# mount /share

Hide old and mount new /var partition

The /var partition the system uses by default lives on the / (root) partition. We've intentionally made / small, so we need another home for the stuff traditionally residing under /var: log files, mail, etc. We're also planning on using /var for our /tmp directory, to give compilers and such plenty of room to stretch out.

Again, these parition names and node numbers may not be right for your system; compare with your fx information.

First, make the devices:

# cd /dev/rdsk
# mknod dks0d1s7
# chmod go-rw dks0d1s7

# cd /dev/dsk
# mknod dks0d1s7
# chmod go-rw dks0d1s7

# cd /dev
# mknod var b 128 23
# chmod go-rw var
# mknod rvar c 128 23
# chmod go-rw rvar
And make the filesystem on it:
# cd /dev
# mkfs rvar
Before you mount it, you must move the old /var files out of the way so we can create the mount point. This is best done on a quiescent system so that mail and log files and such don't get lost -- best to shutdown to single user mode first:
# shutdown -i1

# cd /
# mv var var.ORIG
# mkdir /var
Now put an entry in /etc/fstab for the new /var partition:
/dev/var     /var    efs     rw,raw=/dev/rvar        0 0
Now mount this new /var and copy the existing files from the old /var.ORIG so we have a place to spool mail, logs, etc.
# mount /var

# cd /var.ORIG
# tar cf - . | (cd /var ; tar xpf -)
Now you need to remove /usr/var and replace it with a link to the new /var:
# cd /usr
# mv var var.ORIG
# ln -s ../var var

Chris Shenton