Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!sgi!daveh@xtenk.asd.sgi.com From: daveh@xtenk.asd.sgi.com (David Higgen) Newsgroups: comp.sys.sgi Subject: Re: mklv(1M) help on 3.3.1 Message-ID: <103549@sgi.sgi.com> Date: 13 May 91 21:11:47 GMT References: <1991May13.084225@hiatus.zko.dec.com> Sender: guest@sgi.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 98 In article <1991May13.084225@hiatus.zko.dec.com>, kevin@hiatus.zko.dec.com (Kevin D. Baranski-Walker) writes: > -- > I'm desparately attempting to extend my /usr partition: > > 1) mkfs new disk /dev/dsk/dks0d4s7 (the whole efs disk) > 2) create /etc/lvtab; > > lv1:extended-usr-partition:stripes=2:devs= \ > /dev/dsk/dks0d1s6, /dev/dsk/dks0d4s7 > > 3) take the system down to single user > 4) mklv lv1; > and I get for /dev/dsk/dks0d4s7 > > > What am I missing? Rather a lot, actually. Where on earth did you come up with the sequence of operations you list? There IS a section on using logical volumes to extend filesystems in the System Administrator's guide, but I'll go over it again here. First, please clearly understand the distinction between a logical volume and a filesystem. A logical volume is a DEVICE, not a filesystem. It allows you to "glue" together two or more disk partitions into a "pseudo partition" that looks like a single disk partition. So to extend a filesystem, there are TWO steps. First, you have to create a logical volume for it to reside on. Then you have to grow the filesystem to take advantage of the extra space. Also, note that when you are using logical volumes to grow a filesystem which originally resided on a single partition, the logical volume must NOT be striped. (That would involve "decomposing" all the original filesystem data and shuffling it between the two partitions: for safety & reliability we don't allow that). Here are the steps you need to take. 1) Create an lvtab entry: lv1:extended-usr-partition:devs= \ /dev/dsk/dks0d1s6, /dev/dsk/dks0d4s7 UNstriped, notice. 2) Since you are changing your /usr, you will need to change your /usr entry in /etc/fstab. You'll be going down to singleuser to do the lv creation & growth of the fs, so you won't have full-screen editing available at that time. So unless you're an ed whiz, I suggest you make the new fstab first (make it as a copy of the existing one, then you can just copy it to /etc/fstab when you've made the other changes). Your /usr entry in fstab will currently look something like: /dev/usr /usr efs rw,raw=/dev/rusr 0 0 This has to change, because /dev/usr is a link to the partition the /usr filesystem is on: /dev/dsk/dks0d1s6 in your case. Once you've grown it, however, the filesystem will no longer be accessed via that device, instead, it will be accessed via the new logical volume device /dev/dsk/lv1. So the new fstab entry should be: /dev/dsk/lv1 /usr efs rw,raw=/dev/rdsk/lv1 0 0 Note that you should change to use the full /dev/dsk and /dev/rdsk names. You might think it would be a smart idea to instead just change the /dev/usr and /dev/rusr links to point to the new device: but that'll run you into trouble the next time you install software. The installation tool remakes the /dev/usr and /dev/rusr links to the defaults! 3) Take the system down to single user. 4) /etc/mklv lv1 (Note: if a previous mklv has been run, you might need to use the -f option to mklv. This tells it to ignore any previous assignments). At this point we have created the logical volume where the enlarged filesystem will reside. Next we have to grow the filesystem to actually use this added space: 5) /etc/growfs /dev/rdsk/lv1 Now, your old usr filesystem is enlarged, with all its previous files & directories retained. You might like to do an fsck on /dev/rdsk/lv1 just as a sanity check. 6) Replace /etc/fstab with the new one containing the updated /usr entry you created earlier. 7) Go back to multiuser and proceed with your business! Hope this helps. I will try to answer any queries by email. Dave Higgen (daveh@xtenk.asd.sgi.com)