Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!van-bc!eslvcr!ted From: ted@eslvcr.UUCP (Ted Powell) Newsgroups: comp.sys.att Subject: Re: Disk Partitions under Sys V/386 Summary: A way to rearrange them Keywords: moving disk partitions, cpio Message-ID: <180@eslvcr.UUCP> Date: 1 Sep 89 14:09:05 GMT References: <598@gistdev.UUCP> Reply-To: ted@eslvcr.UUCP (Ted Powell) Organization: Entropy Limited, Vancouver, BC Lines: 129 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 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)