[CentOS] is it safe to resize root, on an LVM system, online?

Rudi Ahlers Rudi at SoftDux.com
Mon Jul 12 12:34:52 UTC 2010


On Mon, Jul 12, 2010 at 2:15 PM, Max Hetrick <maxhetrick at verizon.net> wrote:
> Rudi Ahlers wrote:
>
>> It's a console-only server, i.e. no X installed. So I'll have to setup
>> a test server to see if I can do it without breaking abything
>>
>
> There should be no issues doing it live.
>
> # lvextend -L+1G /dev/myvg/myvol
> # resize2fs /dev/myvg/myvol
>
> Regards,
> Max
> _______________________________________________


Thanx Max, it seems like the upgrade has gone through well:


[root at zaxen02 ~]# lvscan
  ACTIVE            '/dev/LVM01/root' [4.00 GB] inherit
  ACTIVE            '/dev/LVM01/home' [20.00 GB] inherit
  ACTIVE            '/dev/LVM01/var' [4.00 GB] inherit
  ACTIVE            '/dev/LVM01/swap' [4.00 GB] inherit
  ACTIVE            '/dev/LVM01/log' [1.00 GB] inherit
  ACTIVE            '/dev/LVM01/webmin' [2.00 GB] inherit
  ACTIVE            '/dev/LVM01/xenstored' [2.00 GB] inherit
  ACTIVE            '/dev/LVM01/xensave' [2.00 GB] inherit
  ACTIVE            '/dev/LVM01/opennation-net_img' [10.00 GB] inherit
  ACTIVE            '/dev/LVM01/opennation-net_swap' [1.00 GB] inherit
  ACTIVE            '/dev/LVM01/pluto_img' [100.00 GB] inherit
  ACTIVE            '/dev/LVM01/pluto_swap' [1.00 GB] inherit
  ACTIVE            '/dev/LVM01/tmp' [5.00 GB] inherit
[root at zaxen02 ~]# lvextend -L+5G /dev/LVM01/root
  Extending logical volume root to 9.00 GB
  Logical volume root successfully resized
[root at zaxen02 ~]# resize2fs /dev/LVM01/root
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/LVM01/root is mounted on /; on-line resizing required
Performing an on-line resize of /dev/LVM01/root to 2359296 (4k) blocks.
The filesystem on /dev/LVM01/root is now 2359296 blocks long.

[root at zaxen02 ~]# lvscan
  ACTIVE            '/dev/LVM01/root' [9.00 GB] inherit
  ACTIVE            '/dev/LVM01/home' [20.00 GB] inherit
  ACTIVE            '/dev/LVM01/var' [4.00 GB] inherit
  ACTIVE            '/dev/LVM01/swap' [4.00 GB] inherit
  ACTIVE            '/dev/LVM01/log' [1.00 GB] inherit
  ACTIVE            '/dev/LVM01/webmin' [2.00 GB] inherit
  ACTIVE            '/dev/LVM01/xenstored' [2.00 GB] inherit
  ACTIVE            '/dev/LVM01/xensave' [2.00 GB] inherit
  ACTIVE            '/dev/LVM01/opennation-net_img' [10.00 GB] inherit
  ACTIVE            '/dev/LVM01/opennation-net_swap' [1.00 GB] inherit
  ACTIVE            '/dev/LVM01/pluto_img' [100.00 GB] inherit
  ACTIVE            '/dev/LVM01/pluto_swap' [1.00 GB] inherit
  ACTIVE            '/dev/LVM01/tmp' [5.00 GB] inherit
[root at zaxen02 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/LVM01-root
                      8.8G  3.0G  5.4G  36% /
/dev/mapper/LVM01-home
                       20G  6.7G   12G  37% /home
/dev/md0              190M   79M  102M  44% /boot
/dev/mapper/LVM01-var
                      3.9G  1.1G  2.7G  29% /var
tmpfs                 3.8G     0  3.8G   0% /dev/shm
/dev/mapper/LVM01-log
                     1008M   84M  873M   9% /var/log
none                  3.8G  160K  3.8G   1% /var/lib/xenstored
/dev/mapper/LVM01-tmp
                      5.0G  2.2G  2.6G  46% /tmp

-- 
Kind Regards
Rudi Ahlers
SoftDux

Website: http://www.SoftDux.com
Technical Blog: http://Blog.SoftDux.com
Office: 087 805 9573
Cell: 082 554 7532



More information about the CentOS mailing list