[comp.unix.sysv386] Separate /usr/spool partition possible?

rob@xyzoom.info.com (Rob Lingelbach) (11/19/90)

I am about to start a bbs under ISC 2.2, and I only have 2 filesystem
partitions, / and /usr.  I am concerned about fragmentation, and want
to move my news SPOOLDIR out of /usr, and have the bbs file area there
as well.  A friend of mine has installed ESIX on a 386 and he
successfully renamed /usr2 to /usr/spool--a seemingly elegant solution,
as he now doesn't have to get into all the configuration files and
compiled-in localizations to change the file references.

My question is, has anyone done this with ISC 2.2, or is it
theoretically possible?  I have been told that the operating system
"will know what to do" when it wants to write or read /usr/spool and
finds a /usr partition as well.
If it's permissible, I intend to back up the system, then reinstall,
creating 3 partitions, /, /usr, and /usr/spool.  Then restore
(hopefully files from the old /usr/spool/ will go into the new
/usr/spool/).

Thanks in advance for any help.


Rob Lingelbach   KB6CUN   rob@xyzoom.info.com --or-- ..uunet!xyzoom!rob
Compuserve: 71101,176 Packet Radio: KB6CUN@K6IYK 
AMPRNET: kb6cun@kb6cun.ampr.org [44.16.0.106]
2641 Rinconia Dr L.A. CA 90068   voice: 213 464-6266

cpcahil@virtech.uucp (Conor P. Cahill) (11/19/90)

In article <142@xyzoom.UUCP> rob@xyzoom.info.com (Rob Lingelbach) writes:
> [story about renaming partitions deleted]
>
>My question is, has anyone done this with ISC 2.2

Yes this can be done.  All you have to do is edit /etc/fstab and change
the entry for /usr2 to /usr/spool.  If you want to avoid the warnings
about "mounting </usr2> as /usr/spool" then you should unmount /usr2
and run labelit(1M) to label the slice as usr/spool.

If you want a good breakdown of the steps you need to run to split
an already formatted diskette into multiple slices read the FAQP.

>If it's permissible, I intend to back up the system, then reinstall,

You don't have to reinstall unless the size of your root partition is
unacceptable SEE THE FAQP.

>(hopefully files from the old /usr/spool/ will go into the new
>/usr/spool/).

If you alread have the /usr2 partition all you need to do is the following:

	get your machine to single user mode
	cd /usr/spool
	mount /usr2
	find . -depth -print | cpio -pdvmu /usr2
	rm -rf /usr/spool/*
	umount /usr2
	vi /etc/fstab (to change /usr2 to /usr/spool)
	telint 2 (or 3 if you have networking)

-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 

shwake@raysnec.UUCP (Ray Shwake) (11/22/90)

rob@xyzoom.info.com (Rob Lingelbach) writes:

>I am about to start a bbs under ISC 2.2, and I only have 2 filesystem
>partitions, / and /usr.  I am concerned about fragmentation, and want
>to move my news SPOOLDIR out of /usr, and have the bbs file area there
>as well.  

	I wouldn't worry about fragmentation under ISC 2.2; its FFS
	does an excellent job keeping it to a minimum. In any event,
	except for the binaries and data files (esp. if using nn, for
	example) most News data is found in small files anyway, so
	fragmentation is not so critical an issue.

>If it's permissible, I intend to back up the system, then reinstall,
>creating 3 partitions, /, /usr, and /usr/spool.  Then restore
>(hopefully files from the old /usr/spool/ will go into the new
>/usr/spool/).

	Technically speaking, you don't "create" such partitions. Rather,
	you create filesystems and simply "mount" them at specified points
	in the root hierarchy.

gary@sci34hub.UUCP (Gary Heston) (11/29/90)

In article <145@raysnec.UUCP> shwake@raysnec.UUCP (Ray Shwake) writes:
>rob@xyzoom.info.com (Rob Lingelbach) writes:
>
>>I am about to start a bbs under ISC 2.2, and I only have 2 filesystem
>>partitions, / and /usr.  I am concerned about fragmentation, and want
>>to move my news SPOOLDIR out of /usr, and have the bbs file area there
>>as well.  

>	I wouldn't worry about fragmentation under ISC 2.2; its FFS
>	does an excellent job keeping it to a minimum. In any event,
>	except for the binaries and data files (esp. if using nn, for
>	example) most News data is found in small files anyway, so
>	fragmentation is not so critical an issue.

It's not critical, unless directories get too big (like > 10,000 blocks
for the directory entry [not the contents]). Then, your throughput
goes thru the floor like you wouldn't believe. Imagine a ls -al that
doesn't come back in 5 minutes....

>>If it's permissible, I intend to back up the system, then reinstall,
>>creating 3 partitions, /, /usr, and /usr/spool.  Then restore
>>(hopefully files from the old /usr/spool/ will go into the new
>>/usr/spool/).

>	Technically speaking, you don't "create" such partitions. Rather,
>	you create filesystems and simply "mount" them at specified points
>	in the root hierarchy.

Bzzzztt. Partitions are created, then filesystems are initialized into
them. mkpart and mkfs are the respective instructions.

For the benefit of anybody interested, I'm attaching my partition-
juggling cheat sheet. I've set up separate /usr and /usr/spool
partitions here to try and improve performance (cuts down on
seek activity when they're on separate drives). It's not hard, and
if you are using multiple drives, you don't have to back up/restore.
I recommend you back up anyway, as a precaution. mkpart and mkfs are
more final than rm -r *, and faster.

I assembled this over the last couple of years while learning system
administration. I have no objection to anyone propagating this further,
so long as authorship is attributed to me. Inclusion in the FAQ would
be fine with me. It's been used with ISC 1.0.6, 2.0.2, and 2.2 with
no problems. BE CAREFUL, though.

========================== cut here =================================

Garys' partitioning cheatsheet, by Gary Heston. Use at your own risk.

Starting from maintenance mode, with the new drive in place and jumpered:

Edit the /etc/partition file. Note that the start and size values are in
blocks. Make sure you change the "disk#" entry.

Edit /etc/fstab to include names for the new partitions

At this point, nothing has been done to the disc. The next steps will
destroy data, so BE CAREFUL!!!

For each defined partition on the drive, execute the following command:

	mkpart -P (partition name) disk(#)

  where partition name is what was defined in /etc/partitions and # is the
zero-based drive number (for example, partition pb on drive 1 would be
written as  mkpart -P pb disk1 ). NOTE: mkpart executed on disk0 should be
done with extreme caution, as you can destroy any boot capability if you
accidentally overwrite your root partition.

  Next, a file structure must be made for each partition. This is done with
the mkfs command, as follows:

	mkfs /dev/dsk/1s1 101395(:20000)

  where 1s1 is the partition device name, the big number is the size entry
from /etc/partitions and the option in parenthesis is an inode value. Once
more, be careful when working on drive 0 partitions.

  Now, create a directory entry for each of the file structures in the root
directory. This is necessary for the system to have a place to mount the
file structures, and allows access without using the long device name.

  The /etc/fstab file must be edited with an entry for each new partition
added. There should already be entries for all the drive 0 file structures,
which can be used as models for the new ones. They'll look like this:

	/dev/dsk/0s3 /u
	/dev/dsk/0s4 /usr2      # existing drive 0 structures
	/dev/dsk/1s1 /m         # new entries for three structures on
	/dev/dsk/1s2 /e         # drive 1.
	/dev/dsk/1s3 /a

After all the partitions are made, and the file systems created, do a
mountall and a umountall as a test to verify that they will mount/unmount
properly, then repeat that to make sure. If the partitions come up as
corrupted, but do not show any errors after the fsck, check for duplicate
partition names or incorrect data in /etc/partitions.

The final step is to label each partition with labelit:

	labelit /dev/dsk/(partition device) (name) (NAME)

  where the partition device is of the form (drive)s(number)  (the first
partition of drive 1 would be 1s1, drive 0 root partition would be 0s0,
partition 4 of drive 2 would be 2s4, etc..... (name) and (NAME) are lower-
and upper-case entries of the partition name from /etc/partitions. To label
the second partition on drive 1 as pq, the command would be  labelit
/dev/dsk/1s1 pq PQ  (remember that numbering is zero-based--the first
partition would be /dev/dsk/1s0 )

========================== cut here, too ==============================

Enjoy. But (once again) BE CAREFULL!!

-- 
Gary Heston System Mismanager and technoflunky uunet!sci34hub!gary or
My opinions, not theirs.  SCI Systems, Inc.     gary@sci34hub.sci.com
  The sysadmin sees all, knows all, and doesn't tell the boss who's
  updating their resumes....  This .sig Copyright G. L. Heston, 1990