LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-22-2015, 07:19 AM   #1
mtsoule
LQ Newbie
 
Registered: Aug 2012
Posts: 27

Rep: Reputation: Disabled
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:
Code:
    # dd if=/dev/sda conv=sync,noerror bs=64k | gzip –c | split –a3 –b 2G –verbose - /mnt/exthd/
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?
 
Old 01-22-2015, 03:02 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,289

Rep: Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423
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.

Last edited by rknichols; 01-22-2015 at 03:05 PM.
 
1 members found this post helpful.
Old 01-22-2015, 09:41 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,042

Rep: Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332
Might consider a network clone too.

Other tools may help. dd is a good tool but file by file may also be used.
 
Old 01-23-2015, 06:44 AM   #4
mtsoule
LQ Newbie
 
Registered: Aug 2012
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
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.
 
Old 01-23-2015, 11:13 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,289

Rep: Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423
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=".
 
Old 01-23-2015, 03:57 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,042

Rep: Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332Reputation: 2332
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.

Many web pages on using nc and dd too.
 
Old 01-23-2015, 05:18 PM   #7
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,076

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
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.
 
Old 01-26-2015, 01:24 PM   #8
mtsoule
LQ Newbie
 
Registered: Aug 2012
Posts: 27

Original Poster
Rep: Reputation: Disabled
it tries to boot, I get the SLES11 splash screen, then it fails. I will post the full error message tomorrow.
 
Old 01-27-2015, 08:26 AM   #9
mtsoule
LQ Newbie
 
Registered: Aug 2012
Posts: 27

Original Poster
Rep: Reputation: Disabled
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”
 
1 members found this post helpful.
Old 01-27-2015, 08:52 AM   #10
mtsoule
LQ Newbie
 
Registered: Aug 2012
Posts: 27

Original Poster
Rep: Reputation: Disabled
Weird thought... suppose I were to swap the 3 - 250GB drive for 3 - 320GB drives, and dd my image on to it?
 
Old 01-27-2015, 08:56 AM   #11
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,076

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
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.
 
Old 01-27-2015, 09:01 AM   #12
mtsoule
LQ Newbie
 
Registered: Aug 2012
Posts: 27

Original Poster
Rep: Reputation: Disabled
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..
 
Old 01-27-2015, 10:57 AM   #13
mtsoule
LQ Newbie
 
Registered: Aug 2012
Posts: 27

Original Poster
Rep: Reputation: Disabled
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..
 
Old 01-27-2015, 11:26 AM   #14
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,076

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
fingers crossed.
 
Old 01-27-2015, 12:37 PM   #15
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,289

Rep: Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423
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.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail: Relay Messages to Ext. SMTP Server? JmaJeremy Linux - Server 2 02-10-2010 11:59 AM
[IPTABLES] open ext access to web server on GW server kozaki Linux - Networking 3 08-27-2005 05:11 PM


All times are GMT -5. The time now is 10:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration