[lug] unmount needed to shrink lvms?

karl horlen horlenkarl at yahoo.com
Wed Dec 14 17:38:23 MST 2011


i realize now after 2 years or so that that i allocated way too much space to a few LVMs.  i'd like to reclaim some of that wasted space now and allocate it to another LVM that could use the space.


more specifically i created too much space for the following LVMs

/tmp
/var
/usr

is it ok to simply umount these partitions on a *live* server to perform the filesystem resize followed by an lvreduce or do i need to boot from a live or rescue cd to safely perform the ops?

if performing the ops on a *live* server, the system would not be able to write to /var logs if var is umounted for the little time this will take but i'm not sure if that would be a show stopper or not (will it cause the system to get in a bad state?).  if a process or service was using var will it recover ok once /var is brought back online?


all the commands used to perform the operations to achieve this live in /sbin except for the /usr/sbin/lv* cmds, but perhaps i can just copy the one i need (lvreduce) to / filesystem as a workaround for the absence of /usr?  am i missing anything else by unmounting /usr on a *live* server?

umounting /tmp is probably fine for the short amt it won't be accessible?


final question.  


is there any *accurate* way to insure the filesystem reduction size will be less than or equal to the reduced LV?  or is it always a matter of performing the math and making the LV one or five "units" larger than the filesystem when you reduce it just to be safe? for instance, when extending an LV you can make it use 100% available which frees you from having to do the math.  was wondering is on a reduce you could tell it to resize itself to the new reduced filesystem size vs having to calculate and potentially mess up.


thanks




More information about the LUG mailing list