[lug] unmount needed to shrink lvms?

David L. Anselmi anselmi at anselmi.us
Mon Dec 19 20:19:03 MST 2011


karl horlen wrote:
> /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?

You'll need to be in single user mode, so doing it remotely would be tricky.  But you shouldn't need 
to reboot first.

> if a process or service was using var will it recover ok once /var is brought back online?

Since you can't resize while mounted (I suppose that will change one day) you have to stop and start 
those services.  /var doesn't require single user mode but that would be easier.

> 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?

On Debian lv* are in /sbin.  But if you can resize the file system you can reduce the lv while the 
file system is mounted.

If you try to copy lvreduce elsewhere you also need to make sure its libraries are available (mine 
doesn't use /usr/lib but mine isn't in /usr either).

> is there any *accurate* way to insure the filesystem reduction size will be less than or equal to
> the reduced LV?

Use lvreduce -r.

Dave



More information about the LUG mailing list