On 18/11/2018 20:13, Geoffrey Mendelson wrote:
I have an Ubuntu 15.10 system. When I installed it, it defaulted to a regular ext(something) boot partition, and an lvm partition with everything else on it.

There now is a bad spot in the lvm partition. fsck with a read check does not find it. I have moved enough data off of it, so it wont show up in a file copy. 

I will have a new drive tomorrow, intended to replace the old one. The old one is 300 gig, the new one is 1tb.

Normally, I would just partition it, make both file systems ext4, copy the files and run grub.

The lvm volume is something I dont understand.

If there a diskcopy type utility that would do all the work for me?

Is there a howto?

Can I just make the root an ext4 partition on the new disk and skip the lvm?

What would I have to change? I assume grub.conf and /etc/fstab. Anything else?


I'm not exactly sure what it is that you want to do. One thing you can do is (for the time of the transition), connect the new, and then ask LVM to move the data to it. No need to mess with fstab.


Disclaimer: I didn't test the commands here, I don't play with LVM that much. I assume you have a logical volume called LV, that the old physical partition is /dev/sda2 and that the physical partition is /dev/sdb2[1] .


1. Partition the new disk. Create (among others) the partition of type LVM /dev/sdb2

2. Make that partition a physical volume:


pvcreate /dev/sdb2


3. Add the new partition (physical volume) to the logical volume:


vgextend LV /dev/sdb2


4. Move information from this physical volume (this should take a while):


pvmove /dev/sda2


5. Now you can ask LVM to remove the old physical volume (partition) from the logical volume:


vgreduce LV /dev/sda2



[1] This is the name it happens to have right now. It's not the name LVM identifies the partition anyway: it identifies it by an ID written inside the physical volume.


-- Tzafrir

_______________________________________________
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to