[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to Rezize Partition on LVM



ray a écrit :
> I would like to than everyone for the input.  Here is how it was completed:
> 
> Boot into GUI mycomp as root

I thought that logging as root was prohibited by GUI display managers.

> # df -h
> Filesystem                    Size  Used Avail Use% Mounted on
(...)
> /dev/mapper/mycomp--vg-home  427G  136M  405G   1% /home
(...)
> root@mycomp:~# resize2fs /dev/mapper/mycomp--vg-home 5G
> Filesystem at /dev/mapper/mycomp--vg-home is mounted on /home; on-line resizing required
> resize2fs: On-line shrinking not supported

You need to unmount /home first. If you're logged as root, it should work.

> Rebooting into command line interface for root worked, the /home partition was not mounted.

What do you call "command line interface for root" ? Single user mode ?

> # lvreduce -L 5G /dev/mapper/mycomp--vg-home
>   WARNING: Reducing active and open logical volume to 5.00 GiB
>   THIS MAY DESTROY YOUR DATA (filesystem etc.)
> Do you really want to reduce home? [y/n]: y
>   Size of logical volume mycomp-vg/home changed from 433.32 GiB (110931 extents) to 5.00 GiB (1280 extents).
>   Logical volume home successfully resized

I hope you reran the resize2fs command successfully before doing this.
Otherwise you just ruined your /home filesystem.


Reply to: