On Tue, 2005-06-28 at 18:11 -0400, b.ally@xxxxxxxxxxxx wrote: > I've just inherited a box that has a single / volume plus a swap. I'd > really rather have /home seperated. LVM is still new to me so i'd like > someone else's opinion on the steps i've managed to come up with. > > I'd like to reduce the single 75G vol to 20G, then create a /home vol > with the remainder. > > [bally@apollo ~]$ lvdisplay > --- Logical volume --- > LV Name /dev/VolGroup00/LogVol00 > VG Name VolGroup00 > LV UUID us9s35-kxoF-1L92-0zsZ-vJtj-lO7A-Q89zmE > LV Write Access read/write > LV Status available > # open 1 > LV Size 75.25 GB > Current LE 2408 > Segments 1 > Allocation inherit > Read ahead sectors 0 > Block device 253:0 > > --- Logical volume --- > LV Name /dev/VolGroup00/LogVol01 > VG Name VolGroup00 > LV UUID roe2Xm-PbHg-5HwP-5klc-SGRr-65Lx-jSpjuW > LV Write Access read/write > LV Status available > # open 1 > LV Size 960.00 MB > Current LE 30 > Segments 1 > Allocation inherit > Read ahead sectors 0 > Block device 253:1 > > > So, the steps i have so far: > > boot rescue mode > > # tune2fs -O ^has_journal /dev/hda # discontinue journaling > > # lvm > lvm > vgscan > lvm > vgchange --available y VolGroup00 > lvm > exit > e2fsck -f /dev/VolGroup00/LogVol00 # check & repair > resize2fs -p /dev/VolGroup00/LogVol00 20G # resize to 20G > e2fsck -f /dev/VolGroup00/LogVol00 # check & repair > > # lvm > lvm > lvreduce -L20G /dev/VolGroup00/LogVol00 > lvm > lvcreate -L55.25G -nhome # create volume for /home > lvm > exit > e2fsck -f /dev/VolGroup00/LogVol00 # check & repair > e2fsck -f /dev/VolGroup00/home # check & repair > > # tune2fs -O +has_journal /dev/hda # restore journaling > > Does this look OK? And is using tune2fs strictly necessary here? > > Am I heading for a re-install? The turning on and off of journalling isn't needed; resize2fs can handle ext3 filesystems just fine. When I resize a volume, I generally resize the filesystem to be smaller than the size I'm going to change the volume to. This ensures that if there's any discrepancy between the way that resize2fs and lvm treat the sizes you specify (e.g. because lvm must round sizes to fit the extent size for the volume group), the filesystem is always going to fit on the volume. After shrinking the volume using lvreduce, I then use resize2fs again without specifying a size, which causes it to make the filesystem "fit" the volume. Other than that, this process looks OK to me. Paul. -- Paul Howarth <paul@xxxxxxxxxxxx>