[clug] trouble unmounting /var on production system

Tony and Robyn Lewis beakysnugger at yahoo.co.uk
Sun May 14 05:03:48 GMT 2006


Martijn van Oosterhout wrote:

>BTW, something I sometimes did was remount the filesystem read-only. It
>may not be 100% safe, but it will stop the kernel writing stuff to the
>filesystem while you're resizing it.
>
>If you have the filesystem readonly, resize it and then reboot you
>should be fine.
>  
>

Just tried it on a test system, and it didn't work:

tlewis at vserver:~$ sudo lvextend -L+10G /dev/vg0/lv-var
  Extending logical volume lv-var to 110.00 GB
  Logical volume lv-var successfully resized
tlewis at vserver:~$ sudo mount -o remount,ro /var
tlewis at vserver:~$ mount
...
/dev/mapper/vg0-lv--var on /var type ext3 (ro)
tlewis at vserver:~$ sudo resize2fs /dev/vg0/lv-var
resize2fs 1.38 (30-Jun-2005)
/dev/vg0/lv-var is mounted; can't resize a mounted filesystem!

tlewis at vserver:~$ sudo resize2fs -f /dev/vg0/lv-var
resize2fs 1.38 (30-Jun-2005)
/dev/vg0/lv-var is mounted; can't resize a mounted filesystem!

Tony



More information about the linux mailing list