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 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 1
Cloning LVM paritions
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 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
If i use DD i can get this to work but DD copies unused space too which i don't want it to do. Can anyone help?Code: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
Thanks in advance.Code: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 #2Just Joined!
- Join Date
- Jul 2009
- Location
- Michigan
- Posts
- 13
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
Create image:
dd if=/dev/hdb | gzip -c > /image.img
Restore image:
gunzip -c /image.img.gz | dd of=/dev/hdb


Reply With Quote
