Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to copy an LVM logical volume with an ext3 filesystem from one system to a file on another system that I will be able to mount as a loopback device. I have tried the following command to copy the volume:

dd if=/dev/VolGroup01/example-volume bs=1M | ssh target-system dd of=/backup/example-volume-image bs=1M

This gives me a file with the same size as the logical volume however when I try to mount it I get:

[root@target-system backup]# mount -o loop example-volume-image /mnt
mount: you must specify the filesystem type
[root@target-system backup]# mount -o loop -t ext3 dev2-endeca1-rootfs /mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Am I not copying the volume correctly or is it just possibly corrupt?

share|improve this question
    
What is the filesystem type of the original volume? –  Michael Hampton Aug 9 '12 at 20:17
    
Sorry, it's ext3 –  Dave Forgac Aug 9 '12 at 20:18
    
Is there anything related to the failed mount operation in dmesg output? –  Alex Aug 9 '12 at 20:34
    
Nothing in dmesg but there is this in /var/log/messages: Aug 9 16:38:18 target-system kernel: hfs: unable to find HFS+ superblock. Going to try creating the snapshot per answer below. –  Dave Forgac Aug 9 '12 at 20:42
    
So it turned out that the volume I was trying to copy was an old Xen disk image, not just a normally formatted partition. I was able to mount it using losetup as described here: blog.leenix.co.uk/2010/07/… –  Dave Forgac Aug 10 '12 at 20:08

1 Answer 1

up vote 4 down vote accepted

If it is a running lvm, you should create a snapshot of it, and then back up the snapshot. Otherwise your command looks fine. It is better if you unmount the lvm before doing the copying.

Then, force a filesystem check on the resulting loop file before attempting to mount.

share|improve this answer
    
It turned out that my issue was due to the LV being a Xen disk image however this would be the preferred method of copying an LV to a disk image file. –  Dave Forgac Aug 10 '12 at 20:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.