1827807 Members
2795 Online
109969 Solutions
New Discussion

Re: Disk druid

 
SOLVED
Go to solution
Tim Medford
Valued Contributor

Disk druid

When I installed RedHat EL4 I took the defaults as far as disk partitioning. I'm now in a situation where I have:

/dev/mapper/VolGroup00-LogVol00
67829336 2903260 61480524 5% /
/dev/cciss/c0d0p1 101086 19008 76859 20% /boot
none 517328 0 517328 0% /dev/shm

Rather than have a 68gb lvol mounted on / I'd like to break things up. I was thinking I'd leave 8gb for / and then create various other lvols and filesystems for Oracle.

I guess it's probably too late to get back into Disk Druid to set this up? Can I just lvreduce using something like this?

lvreduce -L -58 VolGroup00-LogVol00 ??

Thanks,Tim
3 REPLIES 3
Matti_Kurkela
Honored Contributor
Solution

Re: Disk druid

Ouch. You've managed to create a thorny little problem.

Before reducing the logical volume with lvreduce, you must first shrink the filesystem. Otherwise you'll end up with a filesystem that is trying to store things beyond the end of its container (the logical volume) which will mean bad error messages and data loss when the system starts trying to access the "extra" space.

Looks like ext2online cannot shrink a filesystem online, only enlarge it. So you would need to umount the filesystem to shrink it with resize2fs... but we're talking about the root filesystem, which cannot really be unmounted while the system is running.

IF the RedHat ES4 installation CD's rescue mode has resize2fs available, you could boot in rescue mode (boot from CD and see the instructions for rescue mode in the boot prompt) and resize the root filesystem from there.

After successfully shrinking the filesystem with resize2fs, you can do the lvreduce while the system is running normally.

When re-sizing a combination of a filesystem and its logical volume, always be very careful that the filesystem size stays smaller or equal to the size of its logical volume at all times. So, when reducing size, you first shrink the filesystem and then the underlying logical volume. When enlarging, you grow the logical volume first.

There is a tool called "fsadm" in development which could greatly simplify filesystem/LV resizing operations, but it seems it isn't included in RHES4. Probably RedHat has judged it's not yet mature enough for production use...
MK
Tim Medford
Valued Contributor

Re: Disk druid

Thanks Matti.

It's just a test machine so I think I'll cheat and create /oracle and others just as directories on lvol00.

This is good information to know for next time though! My experience is all with HPUX, very little with Linux.

I'd like to know if most folks bother creating separate logical volumes for the root filesystems. For example on HPUX by default you get lvol1-lvol8 with /stand, swap, /, /var,/usr,/home all mounted as separate filesystems. Seems like in Redhat it wants to put all the root filesystems under lvol00.

For next round seems like 8gb is plenty for the OS and I'll leave the rest unallocated for future use.

THanks, Tim
Steven E. Protter
Exalted Contributor

Re: Disk druid

Shalom Tim,

Since you have used lvm, you can resize, destory, rebuild, do anything you need with an LVM volume with the GUI that ships with the OS.

I know its not real systems administration, but it is a great time saver. LVM is almost as good as disk druid.

As far as I know, there is no way to use disk druid except at installation time.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com