Trying to dd a server with LVM to another ext HD, then to another server
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Trying to dd a server with LVM to another ext HD, then to another server
I have Linux enterprise server 11 sp3 with 3 250 GB WD blue drives in a raid 5 configuration.
Server “A” (external drive not plugged in):
Code:
Disk /dev/sda: 499.0 GB, 499021512704 bytes
255 heads, 63 sectors/track, 60669 cylinders, total 974651392 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00059fd2
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1028095 513024 83 Linux
/dev/sda2 1028096 21993471 10482688 82 Linux swap / Solaris
/dev/sda3 21993472 974651391 476328960 8e Linux LVM
Disk /dev/mapper/VG_SYSTEM-ROOT: 487.8 GB, 487755612160 bytes
255 heads, 63 sectors/track, 59299 cylinders, total 952647680 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VG_SYSTEM-ROOT doesn't contain a valid partition table
I am trying to clone this machine to another server, both servers are Dell Poweredge 1900, with 3 – 250 WD drives (the only difference is the ‘B’ server has WD Cavier drives), pretty much identical machines, same processor and ram. I have a 2TB ext hard drive that I am using to store the output of DD. I have booted from the CD to a rescue system, then mounted my 2TB ext and did the following:
This gives me the following files on my external hard drive:
Code:
-rwxr-xr-x 1 root root 2147483648 Jan 10 21:00 aaa
-rwxr-xr-x 1 root root 2147483648 Jan 10 21:31 aab
-rwxr-xr-x 1 root root 2147483648 Jan 10 21:53 aac
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:05 aad
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:10 aae
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:17 aaf
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:24 aag
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:31 aah
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:37 aai
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:43 aaj
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:50 aak
-rwxr-xr-x 1 root root 2147483648 Jan 10 22:56 aal
-rwxr-xr-x 1 root root 2147483648 Jan 10 23:02 aam
-rwxr-xr-x 1 root root 2147483648 Jan 10 23:06 aan
-rwxr-xr-x 1 root root 2147483648 Jan 10 23:12 aao
-rwxr-xr-x 1 root root 2147483648 Jan 10 23:32 aap
-rwxr-xr-x 1 root root 324998512 Jan 10 23:35 aaq
Now, I boot to the rescue system on server ‘B’ with the external drive plugged in, and run fdisk:
Code:
Disk /dev/sda: 498.8 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders, total 974127104 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00059fd2
Device Boot Start End Blocks Id System
Disk /dev/sdb: 2000.4 GB, 2000398933504 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029167 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00015a3d
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907028991 1953513472 c W95 FAT32 (LBA)
Notice sda is only 498.8GB where on server ’A’, it was 499.0. when I try to restore my files from the DD, I get an out of space error. To restore, I use the following:
Code:
# cat /mnt/exthd/aa* | gunzip –c | dd of=/dev/sda
dd: writing to ‘/dev/sda’: No space left on device
974127105+0 records in
974127104+0 records out
498753077248 bytes (499 GB) copied, 37067.3 s, 13.5MB/s
My guess, is that although the drives are the same capacity (3 – 250GB in RAID 5 array), the number of cylinders is different because it is a different model, and that is where it is running out of space, although I wouldn’t think it would.
Please correct me if I am wrong as I am a newbie, but if I do “# dd if=/dev/sda” that will take all the partitions with it? Such as sda1, sda2, sda3 correct?
Yes, "dd if=/dev/sda ..." will copy everything that is on the drive.
Your problem is that the destination RAID array is 256MB smaller than the source array, so not everything is going to fit. Your 250GB drives do not have a capacity of exactly 250,000,000,000 bytes, so there could be some difference between the source and destination drives. That 256MB difference is only about 0.05% (0.0005) of 500GB, and there is frequently that much difference between drives of the same nominal capacity. It's also possible that differences in the RAID configuration might account for that much difference.
That 256MB difference is only about 0.05% (0.0005) of 500GB, and there is frequently that much difference between drives of the same nominal capacity
I have considered the possibility that although these are 3 - 250GB WD drives, being of a different model they may not be exactly the same. I think I will pick up some of the same model drives and try again.
Quote:
Might consider a network clone too.
I am not sure how to do a network clone, I assume that in doing so 'clone' means identical, bootable and everything.
The output from "fdisk -l /dev/sdX" will show the exact capacity in bytes. You could also run "hdparm -i /dev/sdX" and look at the sector count shown in "LBAsects=".
The issue with dd is that it is not only a clone, it is a bit by bit copy of a drive. It may include many references and in some os's drive info and good or bad licensing schemes.
I'd assume you have Suse and it should have references to various boot and mount options that should either be edited to generic before you clone or you'd have to adjust it later. https://forums.opensuse.org/showthre...to-a-new-disk-!!!
Might consider something like clonezilla, redobackup, or even gparted. Really almost any modern distro that supports your hardware and file systems would work using any number of tools from partimage to dd to tar to cpio.
Even the lowly G4U should be able to clone between the systems.
i doubt the minuscule difference will have a large a affect on the restored system (does it boot up ?; is it showing any signs the the dd restore image is no good ?).
to limit the possibility of an important file being on the last few kilobytes of the image i usually run:
Code:
dd if=/dev/zero of=temp.zero; rm temp.zero
before capturing a dd image backup so that it bunzip2's better.
It does try to boot, I get the splash screen (with the progress bar that is supposed to move as it boots) the progress bas gets to about 1% (if that) then goes to text screen with error:
Code:
PARTIAL MODE incomplete logical volume will be processed.
[ 55.971416] Device-Mapper: table: 253:0: sda3 too small for target: start 2048, len=952647680, dev_size=95213632 Unable to resume VG_SYSTEM-ROOT (253:0)
1 logical volume(s) in volume group “VG_SYSTEM” now active
Could not find /dev/VG_STSTEM/ROOT
Want me to fall back to /dev/VG_STSTEM/ROOT? (y/n)
So I answered ‘y’
Code:
PARTIAL MODE incomplete logical volume will be processed.
[ 767.607543] Device-Mapper: table: 253:0: sda3 too small for target: start 2048, len=952647680, dev_size=95213632 Unable to resume VG_SYSTEM-ROOT (253:0)
1 logical volume(s) in volume group “VG_SYSTEM” now active
not found – exiting to /bin/sh
#
If I answer ‘n’ it just goes to
Code:
not found – exiting to /bin/sh
#
So I booted from the DVD and went to auto repair, and it told me that “No Valid Root Partition Found”
it would leave some empty unused space (maybe you can use gparted live-usb to extend it to the boundary).
you can pour a quart of milk into a gallon container but you cant pour a gallon into a quart carton.
i am not sure if it will resolve the issue you are facing now but i am curious to find out the outcome of this experiment.
Unused space is fine, currently, I have swapped out the original drives in server 'B' with identical drives (mfg and model) as server 'A' in reference to post #2, and rebuilding the RAID array. I will post my results..
I will also pick up some 320GB drives as well and try that..
Quick update: I just installed 3- 250GB drives in server 'B', of the same MFG and model as server 'A' and ran "fdisk -l". notice in post #1, the original server 'B' drives 3-250GB drive gave me an output of "fdisk -l"
Code:
Disk /dev/sda: 498.8 GB, 498753077248 bytes
this time it was identical to server 'A'
Code:
Disk /dev/sda: 499.0 GB, 499021512704 bytes
I am hopeful!! now restoring from my image, this will take several hours, I will post the results! may not get back to it until Thursday..
I hadn't thought about it before, but this is a good example of why you should not try to use more than a drive's nominal capacity. If it's a 250GB drive, don't use more than 250,000,000,000 bytes. Unfortunately, RAID and LVM will default to using however much space is actually there, and conventional partitioning will do that too, but at least there you do have to answer a "how big?" question each time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.