[comp.unix.xenix] Setting inodes on a Xenix filesystem

john@jclyde.UUCP (John B. Meaders Jr.) (07/24/88)

It was suggested to me that I post what I found out about this subject.  The
method follows.

It is assumed you are running SCO Xenix 2.2.1.  In my examples I refer to one
filesystem (usr2).  However, the method is applicable to however many
filesystems you want (up to what is allowed by Xenix).

This preliminary stuff is in regards to splitting a second hard disk (disk 1)
under SCO Xenix.  Method:

	1.  BACKUP the current filesystem(s) on that disk.  The information
	    is fixing to hit the bit bucket.
	2.  Use 'divvy' to break up disk 1 into however many filesystems you
	    want.

If you are going to be doing this freshly (just installing a new drive) you
need to perform these steps first.  Method:

	1.  Format the hard disk.
	2.  You should already have Xenix installed on your primary boot
	    drive (drive 0).
	3.  Enter system maintenance mode and enter:
		/etc/mkdev hd
	    This will drop you into fdisk and you can proceed as if you
	    are installing Xenix from scratch.
	4.  When you get to the prompt 'Do you require block by block control
	    over the layout of the XENIX partition' message enter 'y'.  This
	    will drop you into divvy and you can set up however many
	    filesystems you want (up to seven I believe).

At this point in time you are still in divvy.  Go ahead and quit divvy and
write the information to the disk.  The SCO manual at this point says to
do a:
	mkdev fs /dev/usr2 /usr2

This is fine if you are willing to take the default inodes.  This will also
create the lost+found directory for you as well as the mount directory.  In
other words, it does everything for you at the cost of flexibility.

If you want to assign the number of inodes that *you* want read on.

Method:  (you must be root to do this, preferably in single user mode)
	1.  DON'T do a mkdev fs.
	2.  'mkdir' the mount points.  eg:  your filesystem is /dev/usr2,
	    then 'mkdir /usr2.'
	3.  'mount /dev/usr2 /usr2'
	4.  'df -t'  and write down the TOTAL number of blocks on the
	    filesystem.
	5.  'umount /dev/usr2'
	6.  'mkfs /dev/usr2 xxxxx:yyy 1 zzz'
	     Where:
		xxxxx	- 1/2 (IMPORTANT) of the TOTAL blocks on the disk
			  (in other words, the number of physical 1K
			  allocation units).
		yyy	- The number of inodes you want allocated.
		1	- Interleave per (usually should be a '1').
		zzz	- The number of blocks per cylinder for your disk
			  drive.  This is computed as:
			    (sec per cyl) * (heads per cyl)
	    
	    Example:  (for an ST-251 with 17 sec/track and 6 heads)

	      Want a filesystem of 50000 blocks (25Mb) and 10000 inodes

	      mkfs /dev/usr2 25000:10000 1 102
	7.  Edit /etc/checklist
	    Method:
	      /etc/checklist should already have a /dev/root in it.
	      Use your favorite editor to put your new /dev/filesystem
	      there.
	      Before editing /etc/checklist:
		/dev/root
	      After editing /etc/checklist:
		/dev/root
		/dev/usr2
	8.  Edit /etc/default/filesys
	    Before editing /etc/default/filesys:
	      bdev=/dev/root cdev=/dev/rroot mountdir=/ \
	      desc="The root filesystem" rcmount=no
	    After editing /etc/default/filesys:
	      bdev=/dev/root cdev=/dev/rroot mountdir=/ \
	      desc="The root filesystem" rcmount=no
	      bdev=/dev/usr2 cdev=/dev/rusr2 mountdir=/usr2 \
	      desc="The usr2 filesystem" rcmount=yes
	    BE SURE to have usr2 rcmount say YES, otherwise the filesystem
	    will not be mounted at boot.
	9.  Remount the filesystem.
		mount /dev/usr2 /usr2
	10.  Create lost+found directory.  YOU MUST reserve 64 blocks in the
	     lost+found directory so fsck will work.  To do this just create
	     64 zero_length files in /usr2/lost+found.  lost+found will then
	     show a size of 1024 bytes.  You can delete the 64 null files
	     now.

Steps 2 through 10 of the last mentioned procedure are what 'mkdev fs' does.

Remember to BACKUP before you do this procedure.  All data WILL be lost.
If there are any questions please feel free to write and I will clarify.

Disclaimer:  I am not responsible for any damage to drives, computers, or
	     lost data.  (How's that for a disclaimer :-)).

I would like to thank Karl Denninger (karl@ddsw1.UUCP) and Chip Rosenthal
(chip@vector.UUCP) in particular for their quick response to my request
for help.  Thanks also to everyone else who replied.  Enjoy, and feel
free to correct any mistakes I might have made typing this in.  It works
here.
-- 
John B. Meaders, Jr.  1114 Camino La Costa #3083, Austin, TX  78752
ATT:  Voice:  +1 (512) 451-5038  Data:  +1 (512) 371-0550
UUCP:   ...!uunet!utastro!bigtex!jclyde!john  or  john@jclyde.UUCP