Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    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?

    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
    Thanks in advance.

  2. #2
    Just Joined!
    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

    Create image:
    dd if=/dev/hdb | gzip -c > /image.img

    Restore image:
    gunzip -c /image.img.gz | dd of=/dev/hdb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts