FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 02-27-2010, 11:59 AM
Frederick Abrams
 
Default Resize of LVM PV

Hi All,

I need some help i have a 500GB disk which when i installed F12 i selected the entire HDD to be used by LVM.

I don't need so much HDD for the LVM and I want to shrink the LVM PV to say 300GB and use the rest to install windows to play my games.

I have done the below.

1) Rebooted with Fedora 12 in Rescue mode
2) e2fsck /dev/mapper/vg_fa-lv_root
3) resize2fs /dev/mapper/vg_fa-lv_root 275G
4) lvresize -L 250G /dev/vg_fa-lv_root
5) pvresize --setphysicalvolumesize 300G /dev/sda2

I can't remember but it was something like that

Everything is working perfectly with no data loss the only problem i have is that fdisk doesn't show the correct size and when i boot up the windows disk it says no free space.


[root@fa ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lv_root vg_fa -wi-ao 250.00G
lv_swap vg_fa -wi-ao 5.88G


[root@fa ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg_fa 1 2 0 wz--n- 300.00G 44.12G


[root@fa ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 vg_fa lvm2 a- 300.00G 44.12G


[root@fa ~]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0001bea3

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 60801 488179201 8e Linux LVM


[root@fa ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_fa-lv_root
247G 189G 46G 81% /
tmpfs 2.0G 408K 2.0G 1% /dev/shm
/dev/sda1 194M 57M 128M 31% /boot



--


Fred




--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-27-2010, 04:31 PM
Roberto Ragusa
 
Default Resize of LVM PV

Frederick Abrams wrote:

> 1) Rebooted with Fedora 12 in Rescue mode
> 2) e2fsck /dev/mapper/vg_fa-lv_root
> 3) resize2fs /dev/mapper/vg_fa-lv_root 275G
> 4) lvresize -L 250G /dev/vg_fa-lv_root

Hmmm, 275G filesystem inside a 250G lv??? You should have done the reverse...
Danger.

> 5) pvresize --setphysicalvolumesize 300G /dev/sda2

That's ok.

> Device Boot Start End Blocks Id System
> /dev/sda1 * 1 26 204800 83 Linux
> Partition 1 does not end on cylinder boundary.
> /dev/sda2 26 60801 488179201 8e Linux LVM

Now you have to be brave.
You should remove sda2 and recreate it with a smaller size (for example 310G).
The content should not be lost, as the metadata is at the start of the partition.
(refer another mail of mine from 23/8/2008 "lvm resizing and shifting" on this issue)

If you are still alive, you then:
- enlarge the pv to 310 (try to avoid manual specification, always better autodetect).
- enlarge the lv if you want
- enlarge the filesystem if you want

--
Roberto Ragusa mail at robertoragusa.it
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 02-28-2010, 06:54 AM
Frederick Abrams
 
Default Resize of LVM PV

Hi,

I was afraid someone was going to say that but i was hoping for a more safer method. I think i will take another backup of all my data 1st then do the below suggestion of deleting the /dev/sda2.

Thanks


Fred




On 02/27/2010 09:31 PM, Roberto Ragusa wrote:

Frederick Abrams wrote:



1) Rebooted with Fedora 12 in Rescue mode
2) e2fsck /dev/mapper/vg_fa-lv_root
3) resize2fs /dev/mapper/vg_fa-lv_root 275G
4) lvresize -L 250G /dev/vg_fa-lv_root



Hmmm, 275G filesystem inside a 250G lv??? You should have done the reverse...
Danger.



5) pvresize --setphysicalvolumesize 300G /dev/sda2



That's ok.



Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 60801 488179201 8e Linux LVM



Now you have to be brave.
You should remove sda2 and recreate it with a smaller size (for example 310G).
The content should not be lost, as the metadata is at the start of the partition.
(refer another mail of mine from 23/8/2008 "lvm resizing and shifting" on this issue)

If you are still alive, you then:
- enlarge the pv to 310 (try to avoid manual specification, always better autodetect).
- enlarge the lv if you want
- enlarge the filesystem if you want





--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 09:34 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org