PV and LVM resize ext4

Itamar Reis Peixoto itamar at ispbrasil.com.br
Fri Oct 16 19:59:11 UTC 2009


I think should work .

make a backup first and go ahead.

let us know if worked


On Fri, Oct 16, 2009 at 4:37 PM, Tait Clarridge <tait at clarridge.ca> wrote:
> Hello,
>
> I am about to buy a 60GB SSD to replace my netbook's current 160GB drive
> and wanted to get some feedback whether the process I am thinking of
> taking to resize the drives will work properly.
>
> So here goes:
> My volume group in this example is called: vg_taitsvolume
> The logical volume (root) being resized is: lv_root
> The physical volume is: /dev/sda2
>
> Current Partition Sizes:
>
> /boot - 200M - formatted ext3
> swap - 4GB - swap
> / - 145GB - formatted ext4
>
> There is only ~8GB in use on the / fs
>
> Boot into a LiveCD
>
> e2fsck -f /dev/vg_taitsvolume/lv_root
> resize2fs -p /dev/vg_taitsvolume/lv_root 30G
> lvreduce --size 30G vg_taitsvolume/lv_root --test
> lvreduce --size 30G vg_taitsvolume/lv_root
>
> pvresize --setphysicalvolumesize 40G /dev/sda2
>
> (I chose 40GB to keep it away from the maximum of 60GB so there are no
> issues with block sizes/sectors)
>
> use gparted to resize /dev/sda2 to 40G
>
> dd to smaller drive
>
> use gparted to resize /dev/sda2 to maximum allowed
>
> pvresize /dev/sda2
> lvextend /dev/vg_hornet/lv_root /dev/sda2
> e2fsck -f /dev/vg_hornet/lv_root
> resize2fs /dev/vg_hornet/lv_root
>
>
> So, will this work? Are there any steps I can take out? I haven't really
> played with LVM before (at all) so I thought I would come up with my own
> steps through the man pages and put it to the list to see if anyone has
> either completed what I need to do, or has any tips.
>
> I will be backing up the important files so if something goes wrong it
> is not a problem, but kind of an annoyance.
>
> Thanks,
> Tait
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
> Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
>



-- 
------------

Itamar Reis Peixoto

e-mail/msn: itamar at ispbrasil.com.br
sip: itamar at ispbrasil.com.br
skype: itamarjp
icq: 81053601
+55 11 4063 5033
+55 34 3221 8599




More information about the fedora-list mailing list