Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
12-11-2005, 05:21 PM
|
#1
|
LQ Newbie
Registered: Dec 2005
Posts: 3
Rep:
|
Restoring a split HD image
I have a dual boot computer that switches between Kubuntu and Windows. Due to *ahem* issues with Windows, if I upgraded Windows, I could no longer boot into Windows because I would get a blue screen. It worked fine if I didn't upgrade, but when I did, Windows died (Linux still worked fine though). The other day I decided I wanted to try upgrading Windows again. But first, I made a backup of my Windows partition using "dd if=/dev/hdb1 | split -a2 -b 2000m - windowspart.image" and it seemed to work fine. I got a bunch of files "windowspart.imageXX" on my exteral hard drive, and went to upgrade Windows. It didn't work. So, I booted back into Kubuntu, and used "cat windowspart.image* | dd of=/dev/hdb1" and now I cannot mount my Windows partition or boot into it. At the time that I backed up my Windows partition, i didnt realise there was a "partimage" command, but I tohught that what I did should have worked fine. Did I just lose all the data on my Windows Partition or did I just restore it wrong?
|
|
|
12-13-2005, 05:00 AM
|
#2
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638
Rep: 
|
Why did you split it at all (just curious)? I mean, since you could save all parts anyhow ... I'd rather expected you'd run it through "tar" to compress it.
I'm no way sure but I think the expansion of the "*" in the "cat windowspart.image* | dd of=/dev/hdb1" might go awry. Simple test: how large is the restored image? If it's just of one "windowspart.imageXX"-size, this is it. You'd have to use a small shell script then to restore the image, I'd guess.
|
|
|
12-13-2005, 07:15 AM
|
#3
|
LQ Newbie
Registered: Dec 2005
Posts: 3
Original Poster
Rep:
|
I had to split the files because I was backing up to an external HD formatted with FAT32, which supports files no bigger than 4GB. I'll try typing out all of the image names manually, instead of using "*" and see how that works.
|
|
|
12-13-2005, 09:43 AM
|
#5
|
Member
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578
Rep:
|
I don't think that the * expansion is the problem.
'cat windowspart.image*' is the correct method AFAIK.
(create a small filesystem and test the theory!)
The best test I can think of is to cat all the files
into one large one (yes ... space might be a problem  )
on a linux filesystem, and then mount the image via loopback.
That would at least tell you that your backup is OK.
When you restored your backup were you using exactly the same
partition table?
Has your MBR changed since the backup was made?
|
|
|
12-13-2005, 10:03 AM
|
#6
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638
Rep: 
|
It isn't for files (see http://www.linuxquestions.org/linux/...ssemble_files).
But for dd?
How about using ">" instead of the "|" pipe?
The partition table should lie in the very first sectors of the partition he is trying to restore, so it should be the genuine article  .
MBR is only relevant for the entire harddisk not for a single partition.
|
|
|
12-13-2005, 04:16 PM
|
#7
|
LQ Newbie
Registered: Dec 2005
Posts: 3
Original Poster
Rep:
|
The image file produced was about 80GB (the size of my Windows partition). I would combine all the split files into one, but I cannot do that because I do not have enough space on my Linux partition and am limited by the FAT32 formatting of my external drive.
|
|
|
12-14-2005, 04:35 AM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638
Rep: 
|
@drt1245 please answer all our questions and give an indication what results our suggestions produced, it's easier to help then. It seems that some possibilities remain still unexplored...
Well, at least your first command worked, since it produced 80 GB, so it is some other reason  . Tell us what you find in your further attempts and good luck.
|
|
|
12-14-2005, 05:32 AM
|
#9
|
Member
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578
Rep:
|
Quote:
Originally Posted by JZL240I-U
How about using ">" instead of the "|" pipe?
|
Almost sounds plausible except that a pipe was
used to make a backup in the first place.
Quote:
Originally Posted by JZL240I-U
The partition table should lie in the very first sectors of the partition he is trying to restore, so it should be the genuine article  .
|
No, the command used mentioned hdb1 not hdb,
so the partition table would not have been included.
Quote:
Originally Posted by JZL240I-U
MBR is only relevant for the entire harddisk not for a single partition.
|
The first sector of the disk (MBR) contains the bootloader (446 bytes),
a 64 byte partition table, and a 2 byte signature.
If any changes have occurred to the table since the backup
(in particular the DETAILS for partition 1), then it doesn't
matter how the original data is replaced as the partition entry
probably won't match.
To test that the restored data contains a valid partition, even if the
partition can't be mounted (eg. the partition table is wrong), have a
look at the disk with gpart.
|
|
|
12-14-2005, 05:44 AM
|
#10
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638
Rep: 
|
Quote:
Originally Posted by uberNUT69
Almost sounds plausible except that a pipe was
used to make a backup in the first place.
|
...but a try can't hurt. It's fumbling in the dark anyhow, since none of us knows what happened.
Quote:
Originally Posted by uberNUT69
No, the command used mentioned hdb1 not hdb,
so the partition table would not have been included.
|
Umm, I thought that for the partition table there is no difference between hdb and hdb1, which is the first partition (as opposed to hdb2...x). So you may well be right.
Quote:
Originally Posted by uberNUT69
...If any changes have occurred to the table since the backup (in particular the DETAILS for partition 1), then it doesn't matter how the original data is replaced as the partition entry probably won't match.
|
Agreed.
Quote:
Originally Posted by uberNUT69
To test that the restored data contains a valid partition, even if the partition can't be mounted (eg. the partition table is wrong), have a look at the disk with gpart.
|
Would a backup of the old partition table reside in the superblock backups or is all lost then?
|
|
|
12-14-2005, 05:54 AM
|
#11
|
Member
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578
Rep:
|
Quote:
Originally Posted by JZL240I-U
Would a backup of the old partition table reside in the superblock backups or is all lost then?
|
gpart
or
searching for a 2 byte signature in an 80GB partition
for a table which MAY represent the one you want...
Which would you prefer? 
|
|
|
12-14-2005, 05:58 AM
|
#12
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638
Rep: 
|
Quote:
Originally Posted by uberNUT69
...Which would you prefer? 
|
 
No further comment  .
|
|
|
12-14-2005, 08:11 AM
|
#13
|
Member
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578
Rep:
|
ps. remember that md5sum is your friend
recording the output from
# md5sum /dev/hdb1
BEFORE and AFTER backups might be an idea
You do at least need to find a way to
a: verify that a backup is valid (pref. without restoring it)
b: validating a backup once it's restored.
There are ***_SO_MANY_THINGS_THAT_CAN_GO_WRONG_*** !!!!
pps. If in doubt, blame Bill 
|
|
|
All times are GMT -5. The time now is 01:50 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|