Results 1 to 2 of 2
Hello, I'm attempting to clone a LVM partition that contains a copy of my centos OS to another LVM parition, in using the below commands I can get the data ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-16-2010 #1
- Join Date
- Jun 2010
Cloning LVM paritions
I'm attempting to clone a LVM partition that contains a copy of my centos OS to another LVM parition, in using the below commands I can get the data over to the other parition but it doesn't boot. I'm guessing that it's something to do with hard links but the error is
Creating root device. Mounting root filesystem. mount: could not find filesystem 'dev/root' Setting up other filesystems. Setting up new root fs setuproot: moving /dev failed: No such file or directory no fstab.sys, mounting internal defaults setuproot: error mounting /proc: No such file or directory setuproot: error mounting /sys: No such file or directory Switching to new root and running init. umounting old /dev umounting old /proc umounting old /sys
dd if=/dev/LVM-Storage/OS of=/dev/LVM-Storage/OSNew count=1 bs=512 kpartd -av /dev/LVM-Storage/OS mkdir /tmp/10 mount /dev/mapper/LVM-Storage-OSp1 /tmp/10 vkpartd -av /dev/LVM-Storage/OSNew mkdir /tmp/20 mount /dev/mapper/LVM-Storage-OSp1 /tmp/20 cp -p -R /tmp/10 /tmp/20
- 06-29-2010 #2
- Join Date
- Jul 2009
Just a crazy thought but if dd works for you. Then you could use dd and gzip together. dd would make your bit for bit copy and gzip would eliminate the unused space. Maybe something like
dd if=/dev/hdb | gzip -c > /image.img
gunzip -c /image.img.gz | dd of=/dev/hdb