Partitions will not mount once target system is reimaged using dd


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Partitions will not mount once target system is reimaged using dd
# 1  
Old 05-27-2011
Partitions will not mount once target system is reimaged using dd

I am trying to dd an entire hard drive and copy it to another harddrive and experiencing problems for which I can't seem to find an answer.

Questions:
What do the error messages below indicate? Is there a solution?
Are the error messages due to the difference in drive sizes?
Is it possible to dd from a larger drive size to a smaller drive size? If not is there another, free, solution to reimage linux systems. I'm asking b/c I have secured the source system which took a considerable amount of time using DoD and NSA standards and don't want to lose this work.

The source system is an HP Proliant DL380 G5 using Red Hat Enterprise Linux 6 (2.6.32-71.24.1.el6.x86_64), RAID6, LVM (v2.02) on an ext4 filesystem.

Source system:
1) booted via RHEL live cd into rescue mode
2) unmounted all partitions
3) mounted external harddrive
4) dd source drive to external harddrive using the following:
Code:
dd if=/dev/cciss/c0d0 conv=sync,noerror ibs=1024K | gzip -c > /mnt/sda/name_of_img.gz

Target system:
1) booted via RHEL live cd in rescue mode
2) did not mount any partitions
3) mounted external drive
4) Used the following to dd image onto target drive:
Code:
gunzip -c /mnt/sda/name_of_img.gz | dd of=/dev/cciss/c0d0 conv=sync,noerror obs=1024k

fdisk on source system:
Code:
1027.5GB drive
Device Start End Id System
/dev/cciss/c0d0p1 1 63 83 Linux
/dev/cciss/c0d0p2 63 1092 83 Linux
/dev/cciss/c0d0p3 1092 2120 82 Linux swap 
/dev/cciss/c0d0p4 2120 245930 5 Extended
/dev/cciss/c0dop5 2120 245930 8e Linux LVM
Disk /dev/dm-0: 16.1 GB
Disk /dev/dm-1: 5368 MB
Disk /dev/dm-2: 42.9 MB
Disk /dev/dm-3: 4294 MB
Disk /dev/dm-4: 10.7 GB
Disk /dev/dm-5: 5368 MB
Disk /dev/dm-6: 5368 MB
Disk /dev/dm-7: 10.7 GB
Disk /dev/dm-8: 917.7 GB

fdisk on target system after reimage and reboot:
Code:
880.7 GB
Device Start End Id System
/dev/cciss/c0d0p1 1 63 83 Linux
/dev/cciss/c0d0p2 63 1092 83 Linux
/dev/cciss/c0d0p3 1092 2120 82 Linux swap 
/dev/cciss/c0d0p4 2120 245930 5 Extended
/dev/cciss/c0dop5 2120 245930 8e Linux LVM
Disk /dev/dm-0: 16.1 GB
Disk /dev/dm-1: 5368 MB
Disk /dev/dm-2: 42.9 MB
Disk /dev/dm-3: 4294 MB
Disk /dev/dm-4: 10.7 GB
Disk /dev/dm-5: 5368 MB
Disk /dev/dm-6: 5368 MB
Disk /dev/dm-7: 10.7 GB
dm-8 is missing.

After reimage and reboot of target system:
/dev/cciss/c0d0p2 is mounted as /

Error messages after rebooting the target system:
Code:
Starting udev: [ OK ]
Setting hostname <hostname> [ OK ]
Setting up Logical Volume Management: device-mapper: resume ioctl failed: Invalid argument
Unable to resume VolGroup00-LogVol08 (253:8)
9 logical volume(s) in volume group "VolGroup00" now active 
[ FAILED ]
Checking filesystems
/dev/cciss/c0d0p2: clean, 46302/262144 files, 398491/1048576 blocks
/dev/cciss/c0d0p1: clean, 52/64000 files, 83027/25600 blocks
/dev/mapper/VolGroup00-LogVol00: clean 3838/327680 files, 72018/1310720 blocks
fsck.ext4: Invalid argument while trying to open /dev/mapper/VolGroup00-LogVol08 /dev/mapper/VolGroup00-LogVol08: 
The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something 
else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device>
 
/dev/mapper/VolGroup00-LogVol01: clean, 28/655360 files, 92667/2621440 blocks
/dev/mapper/VolGroup00-LogVol02: clean, 12/655360 files, 79664/2621440 blocks
/dev/mapper/VolGroup00-LogVol03: clean, 84138/327680 files, 723042/1310720 blocks
/dev/mapper/VolGroup00-LogVol04: clean, 5712/327680 files, 144135/1310720 blocks
/dev/mapper/VolGroup00-LogVol05: clean, 84/983040 files, 107055/3932160 blocks
/dev/mapper/VolGroup00-LogVol06: clean, 12/262144 files, 53548/1048576 blocks
/dev/mapper/VolGroup00-LogVol07: clean, 86/2621440 files, 209648/10485760 blocks
[ FAILED]
*** An error occured during the file system check.
*** Dropping you to a shell: the sytem will reboot
*** when you leave the shell.

Not sure what info is needed to solicit help so I have included more detail then may be necessary.

Last edited by pludi; 05-27-2011 at 06:56 AM..
# 2  
Old 05-27-2011
The problem is this: you made a 1:1 copy of a harddisk, and wrote that to a much smaller disk. dd doesn't care about that, and didn't say anything since you specified the noerror option. Everything that's in the final part of the image that didn't fit on the target disk was silently discarded, apparently including a lot of LVM and Ext4 information.

To get a better copy that can handle different disk sizes, take a look at Clonezilla. They claim to be the Norton Ghost equivalent for Linux, but I haven't tested that claim yet.
This User Gave Thanks to pludi For This Post:
# 3  
Old 05-27-2011
Thx. I checked out Clonezilla's site and imaging from a larger to smaller disk is not supported. However, the site refers to Parted as a possibility. I'll check that out as well.
# 4  
Old 05-27-2011
Parted is a partition editor that can expand and shrink a partition or logical volume, not an imaging tool. What you can do is use Parted to shrink all LVMs to the minimal necessary size, shrink the PVs behind the VG, clone the disk to the new system, and reverse the steps there.
# 5  
Old 05-27-2011
Sounds like a good solution. I will work the issue from that angle. Thank you very much.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Copy files between partitions with "without auto-mount" option enabled - possible?

Hello, fellow Unixers and Macers, I'll run several OS X versions each on its own dedicated partition. Partitions won't be seeing each other (by editing fstab). Question: will I be able to copy files between those partitions? Partition #1: Mavericks. Partition #2: HighSierra (2 Replies)
Discussion started by: scrutinizerix
2 Replies

2. AIX

Cannot mount file system

Hi , We i try to mount aix filesystem i am getting the following error mount: 0506-324 Cannot mount /dev/fslv11 on /testdir: A system call received a parameter that is not valid. Please help me out (2 Replies)
Discussion started by: chidori
2 Replies

3. UNIX for Advanced & Expert Users

Which system calls to move data on a device with mounted partitions?

I need to be able to move data around a disk that has mounted partitions. I am not touching the data on the mounted partition, the MBR or any other disk metadata, only the freespace and unmounted partitions. At the moment I am using libparted but it causes data corruption sometimes although there... (1 Reply)
Discussion started by: vstrom
1 Replies

4. HP-UX

how to mount a file system from a solaris server into an hp-ux system

Hi all I wonder if its possible to mount on a hp-ux server a file system that was previously mounted on a solaris 10 server. The LUN is on NetApp stoarge. The problem on hp-ux I cannot do pvcreate on the lun (disk) because contains data. Any help will be appreciated FR (2 Replies)
Discussion started by: fretagi
2 Replies

5. Solaris

Need help to boot a server and mount all partitions

Hello, I am having an issue with a SUN FIRE V440. First of all, lots of mirrors and submirrors needed maintenance, so I applied #metasync to fix all of them, but I still couldn't mount all the partitions of the server . I tried to mount manually all the partitions that appear in the /etc/vfstab... (4 Replies)
Discussion started by: feg
4 Replies

6. UNIX for Advanced & Expert Users

Can You Mount FAT32 iSCSI Target in Solaris 10 (sparc)?

I get "mount: I/O error" when trying to mount an existing FAT32 iSCSI target. I also tried formatting the iSCSI target with fdisk and got fdisk: "Error in ioctl DKIOCSMBOOT" Details -- According to the format command, the whole disk is allocated to slice 6 and /dev/rdsk shows this as:... (1 Reply)
Discussion started by: ctafret
1 Replies

7. Solaris

Can You Mount FAT32 iSCSI Target in Solaris 10 (sparc)?

I get "mount: I/O error" when trying to mount an existing FAT32 iSCSI target. I also tried formatting the iSCSI target with fdisk and got fdisk: "Error in ioctl DKIOCSMBOOT" Details -- According to the format command, the whole disk is allocated to slice 6 and /dev/rdsk shows this as:... (0 Replies)
Discussion started by: ctafret
0 Replies

8. Shell Programming and Scripting

FTP files to target Mainframe system

Hi Experts... Greetings for the day..! I just want to FTP the files to mainframe system.. my code is not working..and also i need to put the files in a particular directory in a specific naming format... ftp -i -n ${HOST_NAME} << END_FTP user ${USER_NAME} ${PASSWORD} put ${FILE_NAME}... (3 Replies)
Discussion started by: spkandy
3 Replies

9. UNIX for Dummies Questions & Answers

how to mount a file system of a remote machine to local file system

Hi friends, In my case, there are serveral PCs running Linux in a LAN. I would like to to mount the directory /A_river of machine-A to the file system of another machine machine-B so that I can access files in that directory. I do not know how to do this. The situation is complicated by... (2 Replies)
Discussion started by: cy163
2 Replies

10. UNIX for Advanced & Expert Users

AIX / bull Dynamic System Partitions

Hi does any body knows some usefull oneline ressources about systemp partitioning ? A FaQ would be perfect... thanks (0 Replies)
Discussion started by: pinguis
0 Replies
Login or Register to Ask a Question