On 2020-05-05 13:59, Ed Greshko wrote:
> On 2020-05-05 11:19, Samuel Sieb wrote:
>> On 5/4/20 7:10 PM, linux guy wrote:
>>> # lvreduce -L 6G /dev/mapper/fedora_localhost--live-home
>>>    WARNING: Reducing active and open logical volume to 6.00 GiB.
>>>    THIS MAY DESTROY YOUR DATA (filesystem etc.)
>>> Do you really want to reduce fedora_localhost-live/home? [y/n]:
>>> Is lvreduce smart, ie does it know not to touch existing data ?
>> I expect you need to resize the filesystem first before resizing the volume. 
>>  But also, you can't shrink ext4 while it's mounted.
>>
> Yes, I just did it on a VM to test.  I booted from a LIVE image so the 
> nothing was mounted.
>
> BEFORE
>
> [root@f30g ~]# lvs
>   LV   VG          Attr       LSize   Pool Origin Data%  Meta%  Move Log 
> Cpy%Sync Convert
>   root fedora_f30g -wi-ao---- <17.00g                                         
>           
>   swap fedora_f30g -wi-ao----   2.00g
>
> ran e2fsck on the file system
> ran resize2fs to shrink it

Oh, forgot that before doing the lvresize I did lvchange to deactivate the LV

> ran lvresize with -L to shrink the root LV
>
> Since this was a VM with no real users I didn't have a separate /home.  So, I
>
> ran lvresize with -L to increase the swap LV
> ran mkswap to remake the swap partition
>
> AFTER
>
> [root@f30g ~]# lvs
>   LV   VG          Attr       LSize  Pool Origin Data%  Meta%  Move Log 
> Cpy%Sync Convert
>   root fedora_f30g -wi-ao---- 16.00g                                          
>          
>   swap fedora_f30g -wi-ao----  2.80g
>
>
>


-- 
The key to getting good answers is to ask good questions.
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org

Reply via email to