[comp.sys.att] Disk Partitions under Sys V/386

joe@gistdev.UUCP (Joe Brownlee) (08/31/89)

I have a 6386 WGS on which I am about to install UNIX System V/386, version
3.2.  The machine has two disk drives: a 72 MB and a 40 MB drive.  I wish to
place partitions on the disks such that /, swap, and a /usr2 partition are
on the first disk (the 72 MB), and /usr is on the 40 MB.  OK, so far.

The problem seems to be that when you are installing UNIX, the installation
software only knows about the first disk.  Since this is the case, it insists
that /, swap, and /usr all be placed on the same disk.  You can add the second
disk using FACE later, but you have to have the machine up under UNIX first.
Given that placing /, swap, and /usr on the same disk is not the most efficient
way to configure a UNIX machine, I assume that I must be missing something
somewhere.

Does anyone have any experience on how to place the / and /usr partitions on
different disks using the hardware and software described above?  Any help
would be _greatly_ appreciated!  Thanks in advance.

Joe Brownlee       | Captain, please -- not in front of the Klingons.
GIST, Inc.         |                                -- Mr. Spock, Star Trek V
1800 Woodfield Dr. | Pay attention to what I say, and you might start a trend.
Savoy, IL 61874	   | ARPANET: joe%gistdev@uxc.cso.uiuc.edu
(217) 352-1165	   | UUCP   : {uunet,pur-ee,convex}!gistdev!joe

cpcahil@virtech.UUCP (Conor P. Cahill) (09/01/89)

In article <598@gistdev.UUCP>, joe@gistdev.UUCP (Joe Brownlee) writes:
> 
> The problem seems to be that when you are installing UNIX, the installation
> software only knows about the first disk.  Since this is the case, it insists
> that /, swap, and /usr all be placed on the same disk.  You can add the second
> disk using FACE later, but you have to have the machine up under UNIX first.
> Given that placing /, swap, and /usr on the same disk is not the most efficient
> way to configure a UNIX machine, I assume that I must be missing something
> somewhere.

Why not just install the software with /usr on the  main disk, use FACE 
to format and partition the second disk, mount the second disk and copy
/usr onto the partition on the second disk, unmount the second disk,
umount /usr, mount second disk as /usr.  You would also have to modify
the /etc/fstab file to indicate the new disk partition for /usr and
you probably would want to labelit the new partition with "usr".  

After this you will have the partiton from the first disk to do 
as you wish.
-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+

metro@asi.UUCP (Metro T. Sauper) (09/01/89)

From article <1108@virtech.UUCP>, by cpcahil@virtech.UUCP (Conor P. Cahill):
> Why not just install the software with /usr on the  main disk, use FACE 
> to format and partition the second disk, mount the second disk and copy
> /usr onto the partition on the second disk, unmount the second disk,
> umount /usr, mount second disk as /usr.  You would also have to modify
> the /etc/fstab file to indicate the new disk partition for /usr and
> you probably would want to labelit the new partition with "usr".  
> 
> After this you will have the partiton from the first disk to do 
> as you wish.

I would be careful moving /usr off of the supported first drive.  It may 
make your configuration difficult to upgrade if AT&T ever comes out with
an upgrade which requires you to boot a Unix floppy.  Quite possibly the
unix on the floppy might not support the second drive.  This is a problem
which exists (used to exist??) with 3b2's.  you could not put your /usr
volume on an XM unit and still be able to upgrade your unix using the normal
upgrade procedures.

Of course, you do what you have to do. You may pay the price now or later.

Metro.
-- 
Metro T. Sauper, Jr.                              Assessment Systems, Inc.
Director, Remote Systems Development              210 South Fourth Street
(215) 592-8900                 ..!asi!metro       Philadelphia, PA 19106

ted@eslvcr.UUCP (Ted Powell) (09/01/89)

In article <598@gistdev.UUCP> joe@gistdev.UUCP (Joe Brownlee) writes:
>I have a 6386 WGS on which I am about to install UNIX System V/386, version
>3.2.  The machine has two disk drives: a 72 MB and a 40 MB drive.  I wish to
>place partitions on the disks such that /, swap, and a /usr2 partition are
>on the first disk (the 72 MB), and /usr is on the 40 MB.  OK, so far.
>
>The problem seems to be that when you are installing UNIX, the installation
>software only knows about the first disk.  Since this is the case, it insists
>that /, swap, and /usr all be placed on the same disk.  You can add the second
>disk using FACE later, but you have to have the machine up under UNIX first.

I would say, keep the install script happy; lie to it. Let it believe
you really _want_ /, swap, and /usr on the first disk. But for the size
of /usr, tell it the size you're going to want /usr2 to be. (This only
works, of course, if your desired size for /usr2 is big enough for the
install script to put everything in that it wants.) Follow the normal
install procedure until you've got the base system and the editing
package installed. Make sure you can use vi at this point; the terminfo
file for the console (AT386) should be installed by now. Of course, you
could install the whole system at this point, it's just that if you
follow the procedure below and it (heaven forbid!) doesn't come out
quite right, you've got less time invested. Come to think of it, you're
going to have to install enough stuff so that you can have FACE set up
the second disk as /usr2 and whatever else. Make /usr2 whatever size
you're going to want /usr to be (likely the whole disk).
    Caveat: I've never added a second disk to a 6386WGS (to a MicroVax
II, yes, but that's another story...). However, I _have_ shuffled
partitions on a single (300mb) disk a couple of times, most recently
this afternoon.
    At this point, you should have /usr (on the first disk) all set up
with all kinds of good stuff in it, and /usr2 (on the second disk) with
nothing in it except probably a directory called lost+found; we want
to get everything that's in /usr into /usr2, flip their names around,
and finally delete everything out of the partition on the first disk
(except lost+found).
    Log in as root. Check the file /etc/fstab. It should have two lines
in it, associating /dev/dsk/0s3 with /usr and /dev/dsk/1swhatever with
/usr2. Later we'll be flipping these, so it's good to know they are
there (the second line should have been added when you added the second
disk). 
    Go into "single-user" mode; you don't want things shifting around
underfoot. Do this with:
    cd /; shutdown -g0 -y -is
You will need to give the root password to get into maintenance mode or
whatever they call it (you'll be prompted for it).
    Caveat again: Check all this against your manuals. I'm typing this
from notes I made this afternoon, but I'll be changing it slightly to
match (my perception of) your circumstances, and I can't promise it will
be typo-free.
    Once you are in single user/maintenance mode, make sure your path
and TERM are ok. Do:
    PATH=/bin:/etc:/usr/bin
    TERM=AT386
    export PATH TERM
Make sure both /usr and /usr2 are mounted by doing:
    mountall
Check that you can run vi. Try vi /etc/fstab, but don't change anything
at this time.

Now for the big copy. Do:
    cd /usr
    find . -depth -print | cpio -padlmv /usr2
This will take a while, depending how much stuff is in /usr. You'll find
this given as an example at the end of the manual page for CPIO(1),
except that I've added the -a option to preserve access times as well.
This way of doing the copy preserves just about everything. There's an
example in TAR(1) of doing the copy with a couple of tar's, but (for
SVR3.2v2.1 on 6386WGS) it was my experience that directory attributes
didn't come out right. During the time I was wrestling with this a
couple of weeks ago on a different 6386, I also tried COPY(1), but was
also dissatisfied with that, for reasons that I may or may not have
written down somewhere.
    Meanwhile, back at the system, you should have built yourself an
exact copy (ownerships, permissions, and all) of /usr on /usr2. Make
sure that /usr2/lost+found is ok; if cpio overwrote it with a copy of
the one from /usr (I'm not sure if it would, since what I did didn't
entail copying lost+found), then the new version should be the same size
as before (i.e. not truncated to 32 bytes). Do some spot checks to
satisfy yourself that /usr2 is now a duplicate of /usr.

Now we do the swap. The partitions need to be unmounted before you can
change their names. You can unmount everything in /etc/fstab (which
should be just /usr and /usr2) by doing:
    cd /
    umountall
The cd to / is because the current directory was /usr, which would have
prevented you from unmounting it. To label /usr and /usr2 the other way
around:
    labelit /dev/dsk/0s3 usr2 disk0
    labelit /dev/dsk/1s1* usr disk1  # *get the correct designation
				     # of this partition from /etc/fstab
Make sure you don't use the option flag to labelit which causes it to
wipe the partition (I'm not mentioning the option letter; you don't need
_any_ option letters for a name change). Replace the device designation
in the second labelit command with whatever is correct for the partition
on the second disk that was /usr2 and is becoming /usr.
    Edit /etc/fstab and change /usr to /usr2, /usr2 to /usr. Check it
twice. Do:
    mountall
which should go without any fuss. Now /usr should reference the second
disk, with all the files you copied there, and /usr2 should reference
the first disk, with the files put there by the install process.
    Once you're satisfied that everything is as it should be, you want
to remove the files under what is now /usr2 (on the first disk). You can
do this, for example, with:
    cd /usr2
    rm -rf <all the entries in /usr2 except lost+found>
or if you want to save on typing, try this first with something like
'echo' instead of 'rm -rf':
    cd /usr2
    rm -rf `ls | grep -v lost+found`
Now you should have nothing but lost+found in /usr2 (on the first disk)
and in /usr (on the second disk) you should have an exact copy of what
you originally installed on the first disk's /usr.

Now reboot. Do:
    shutdown -g0 -y
and hit the reset button rather than going straight from single user
state to multiuser state; the latter, in my experience, doesn't start
the printer scheduler (SVR3.2v2.1 for AT&T 6386WGS).

If neither of us made any typos, your /usr and /usr2 should now be where
you want them.  Good luck, and remember your mileage may vary!    :-)

(In my case, what I was doing was moving the stuff under /usr/u (i.e.
all the users' files) to a partition which used to be /usr2. The latter
is now called 'u' and mounts on the directory /usr/u.)
-- 
ted@eslvcr.wimsey.bc.ca   ...!ubc-cs!van-bc!eslvcr!ted    (Ted Powell)

joe@gistdev.UUCP (Joe Brownlee) (09/02/89)

In article <1108@virtech.UUCP> cpcahil@virtech.UUCP (Conor P. Cahill) writes:
>In article <598@gistdev.UUCP>, joe@gistdev.UUCP (Joe Brownlee) writes:
>> 
>> [I asked about putting / and /usr on different disks under Sys V/386]
>
>Why not just install the software with /usr on the  main disk, use FACE 
>to format and partition the second disk, mount the second disk and copy
>/usr onto the partition on the second disk, unmount the second disk,
>umount /usr, mount second disk as /usr.  [...]
>+-----------------------------------------------------------------------+
>| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
>| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
>+-----------------------------------------------------------------------+

I had thought of this, and I got e-mail from some other folks who suggested it,
too.  Well, I tried it and it worked fine.  I did have to re-boot to get the
thing to let go of the original /usr, but when it came back up I unmounted and
re-labelled it, and all was well.  Thanks everyone who responded; you gave me
confidence that my solution was the right one!

Joe Brownlee       | Captain, please -- not in front of the Klingons.
GIST, Inc.         |                                -- Mr. Spock, Star Trek V
1800 Woodfield Dr. | Pay attention to what I say, and you might start a trend.
Savoy, IL 61874	   | ARPANET: joe%gistdev@uxc.cso.uiuc.edu
(217) 352-1165	   | UUCP   : {uunet,pur-ee,convex}!gistdev!joe

ted@eslvcr.UUCP (Ted Powell) (09/02/89)

In article <604@gistdev.UUCP> joe@gistdev.UUCP (Joe Brownlee) writes:
>I had thought of this, and I got e-mail from some other folks who suggested it,
>too.  Well, I tried it and it worked fine.  I did have to re-boot to get the
>thing to let go of the original /usr, but when it came back up I unmounted and
>re-labelled it, and all was well.  Thanks everyone who responded; you gave me
>confidence that my solution was the right one!

Glad to hear it all went well.
If you have the machine in system maintenance mode ("single-user state"), 
so you don't have the print spooler and who-knows-what-else running and
likely referencing /usr, and if you make sure your own working directory
is not in /usr, then it should unmount with no problem.

Forewarned-is-forearmed dept:
Why don't you try booting from the #1 floppy of the Foundation Set. When
it asks if you want to do an install, hit Del, which will get you a
shell prompt. Then try to mount a partition from the second drive onto
/mnt (I expect that you've seen by now the posting warning that this may
not be possible). If it _doesn't_ work, you might consider having /usr
on the first disk, and /usr/u on the second, with all the user home
directories in /usr/u. This still gets the swap area and user files on
separate drives, but leaves all the system stuff where the floppy-based
kernel can find it. However, I expect that you will be ok the way you
are.  BTW, the boot floppy doesn't have "ls", but echo * works.

Happy hacking!
-- 
ted@eslvcr.wimsey.bc.ca   ...!ubc-cs!van-bc!eslvcr!ted    (Ted Powell)

pcg@thor.cs.aber.ac.uk (Piercarlo Grandi) (09/03/89)

In article <598@gistdev.UUCP> joe@gistdev.UUCP (Joe Brownlee) writes:

   I have a 6386 WGS on which I am about to install UNIX System V/386, version
   3.2.  The machine has two disk drives: a 72 MB and a 40 MB drive. I wish to
   place partitions on the disks such that /, swap, and a /usr2 partition are
   on the first disk (the 72 MB), and /usr is on the 40 MB.  OK, so far.

Actually you want to have the 40 meg disc with '/,/tmp,/usr' as
the first disk, and the 72 meg one with 'swap,/usr2' as the
second disc, for good performance reasons.

   The problem seems to be that when you are installing UNIX, the installation
   software only knows about the first disk.

You can do all you want if you do not use the automatic install
to the end. Just have it create the mini root on the hard disc, of the
size you want it to have; lie to the disk setup program so that the root
partition comes out of the right size.

Once you have booted the hard disc with the mini root, edit /etc/partitions
in the way that suits you most, adding in the second hard disc, and
partitioning the disc as you best please. I would advise having the following
setup:

	disc0:
		root: 10 megs [0s1]
		/tmp: 4 megs [0s2]
		/usr: 26 megs [0s3] (you will want to put here /usr/local)

	disc1:
		swap: 8 megs [1s2]
		/usr2: 64 megs [1s3]

For every partitions you have to invoke 'mkfs' and 'labelit'; a
good guide to the number of inodes to configure with mkfs, is 1
for every 10 sectors, i.e. just drop the last digit from the
number of sectors, and use that as the number of inodes, e.g.
'mkfs /dev/rdsk/1s3 128000:12800 x y'.

Notice that the kernel you are running will use by default '0s2'
as the swap device; delay setting up the '/tmp' partition until
you have added the line 'swapdev=hd(18,0)' to
'/etc/default/boot'. If your system crashes on this, you must
edit by hand '/etc/conf/pack.d/kernel/space.c' and set the
'nswap' variable to the number of sectors in '1s2'.

	Note: having the swap partition on a disc that is not the one
	holding the binaries (that is, the root and '/usr' partitions)
	may be almost as big a win as not having '/tmp' on the same disc
	as your most frequently edited/compile files.

Once you have your filesystems made and labeled, just mount them and use
the package installation script to load the rest of the root partition and
'/usr', and the optional components (SDS, ETI, etc...).
--
Piercarlo "Peter" Grandi           | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcvax!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk