FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
when I originally installed FC3 on my webserver / mailserver at home I used LVM to join two 20GB hard drives into one 40gb logical volume.
I now have an extra 80gb drive that I would like to install into that box to replace the 40GB logical volume.
Any ideas on what would be the best way to move away from the logical volumes to one regular volume, without totally redoing the entire setup?
Here are some commands from my machine:
# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID sI0iHC-irla-CdaF-iWh9-VQxC-U1sM-pRwoKt
LV Write Access read/write
LV Status available
# open 1
LV Size 37.34 GB
Current LE 1195
Segments 2
Allocation inherit
Read ahead sectors 0
Block device 253:0
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol01
VG Name VolGroup00
LV UUID xxAJSm-BaQ0-spnd-QeTG-sN4K-Tov7-ECh0BZ
LV Write Access read/write
LV Status available
# open 1
LV Size 512.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:1
# vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 37.91 GB
PE Size 32.00 MB
Total PE 1213
Alloc PE / Size 1211 / 37.84 GB
Free PE / Size 2 / 64.00 MB
VG UUID 02Fevp-4SHU-Z9UO-X045-YOqa-4nZF-o5r47A
# pvdisplay
--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup00
PV Size 18.91 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 605
Free PE 0
Allocated PE 605
PV UUID rWIbJh-UXPW-s5zy-xRSF-s3eG-BhGi-uS14mr
--- Physical volume ---
PV Name /dev/hdb1
VG Name VolGroup00
PV Size 19.00 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 608
Free PE 2
Allocated PE 606
PV UUID zhYtFd-7ERI-DaUI-Xsp5-NWOt-UgZX-zEoaOS
Compress and tar all your data and configuration files to an external USB drive. Install the new OS under the new drive then restore.
Or, install the new drive, create the VG and LVs, mount them, copy the root partition to one LV, setup the new MBR and grub menu on the new drive. Unplugg the older drives, plug new drive and test.
I just cleaned up some data, so now my usage is less than one 20gb disk.
Is there anyway that I can REMOVE lvm from this machine, which would result in all the data being on one of the 20gb drives? Then I would like to just use a tool like ghost to ghost that drive over to the 80gb drive and then I wouldn't have to mess with grub?
You don't need ghost; you can do it with dd. However, you will still need to expand the partition with parted. The fastest and safest way would be to mount both drives and then copy the data over to the new drive, initialize grub on the new drive then restart with the new drive. This is especially useful for a quick and dirty upgrade to a production server.
You don't need ghost; you can do it with dd. However, you will still need to expand the partition with parted. The fastest and safest way would be to mount both drives and then copy the data over to the new drive, initialize grub on the new drive then restart with the new drive. This is especially useful for a quick and dirty upgrade to a production server.
Ok, this is what I'll do tonight, any tips or links on the proper way to get grub setup on the new drive?
No, you need to boot with a rescue CD first. At the boot: prompt of the install CD type 'linux rescue'. It will drop you to a prompt. Run 'fdisk l' to detect both drives. Run:
dd if=/dev/hda of=/dev/hdc
and wait about one or more hours. dd takes very long. hence, if you're in a hurry then use ghost.
After run 'grub' then:
grub> root (hd1,0)
grub> setup (hd1)
Turn PC off, swap drives and test. Turn off again and use a rescue disk that has parted such as Knoppix or Sysresccd to expand the partition on the bigger new drive.
I booted via Knoppix b/c I didn't have a rescue CD that worked correctly. I opened up a terminal window and did an 'su' and then did fdisk -l.
I could see all 3 HDDs.
So I started with 'dd if=/dev/hda of=/dev/hdd'
I thought this might be wrong and did a ctrl-c after about a minute, and did fdisk -l again, I saw that now hda and hdd had an identical layout, so I restarted with the same dd command as above.
Once this is done, from your instructions you say to do grub, next:
grub> root (hd1,0)
grub> setup (hd1)
I was thinking that I might be able to just install hdd into the IDE chain where hda *was* and leave hdb in place. (skipping the grub step above)
How do I go about getting any data that *might* be on hdb onto the new 80gb drive?
Mount /dev/hdb1 to a temporary folder like /mnt/hdb1 then copy whatever you need from /mnt/hdb1. If hdb1 has an LV then you'll first need to run 'vgchange -a', I think, in order to activate the LV.
I have rebooted with the 80gb drive in place of the old disk which had /boot on it.
It now has hda1, hda2, hda3, and hda4. hda1 and hda2 were the old partitions which were copied over via dd. I created hda3 and hda4 and added them to the VolGroup. This is what the vgdisplay shows now:
#vgdisplay
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 11
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 4
Act PV 4
VG Size 95.19 GB
PE Size 32.00 MB
Total PE 3046
Alloc PE / Size 1936 / 60.50 GB
Free PE / Size 1110 / 34.69 GB
VG UUID 02Fevp-4SHU-Z9UO-X045-YOqa-4nZF-o5r47A
and the Physical Volumes:
#pvdisplay
--- Physical volume ---
PV Name /dev/hda2
VG Name VolGroup00
PV Size 18.91 GB / not usable 0
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 605
Free PE 0
Allocated PE 605
PV UUID rWIbJh-UXPW-s5zy-xRSF-s3eG-BhGi-uS14mr
--- Physical volume ---
PV Name /dev/hdb1
VG Name VolGroup00
PV Size 19.00 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 608
Free PE 608
Allocated PE 0
PV UUID zhYtFd-7ERI-DaUI-Xsp5-NWOt-UgZX-zEoaOS
--- Physical volume ---
PV Name /dev/hda3
VG Name VolGroup00
PV Size 28.47 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 911
Free PE 170
Allocated PE 741
PV UUID b0HE2V-nHvU-7dmP-sSyB-fvuN-ujfd-sVrxeQ
--- Physical volume ---
PV Name /dev/hda4
VG Name VolGroup00
PV Size 28.81 GB / not usable 0
Allocatable yes
PE Size (KByte) 32768
Total PE 922
Free PE 332
Allocated PE 590
PV UUID GyvDXf-M8F6-2j1u-kn6y-cdVH-96pr-FQQ4QB
and Logical Volumes:
# lvdisplay
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID sI0iHC-irla-CdaF-iWh9-VQxC-U1sM-pRwoKt
LV Write Access read/write
LV Status available
# open 1
LV Size 60.00 GB
Current LE 1920
Segments 4
Allocation inherit
Read ahead sectors 0
Block device 253:1
If you notice the Logical volmes are only 60GB while the volume group shows 95GB. I thought I needed to do something like this for pvmove to work.
I then tried to do 'pvmove /dev/hdb' which then tried to remove hdb but that failed.
Am I getting any closer to being able to remove that HDB disk?
I remember having a similar problem. I think after you add an a partition to an LV then you need to extend the LV to occupy the empty space in the underlying partition. You need to unmount the LV then run something like 'lvextend -L 20GB /dev/VolGroup00/LogVol00'. That will make it extend. However, do this only after unmounting. Do it with a linux rescue session or with a Knoppix disk if necessary after running 'vgchange -a'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.