LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 12-11-2005, 05:21 PM   #1
drt1245
LQ Newbie
 
Registered: Dec 2005
Posts: 3

Rep: Reputation: 0
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?
 
Old 12-13-2005, 05:00 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638

Rep: Reputation: Disabled
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.
 
Old 12-13-2005, 07:15 AM   #3
drt1245
LQ Newbie
 
Registered: Dec 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 12-13-2005, 09:22 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638

Rep: Reputation: Disabled
Nono, that won't work (probably), you still have to concatenate them to for the image.

How large was the image you produced with your original procedure?

Why don't you try a pure dd statement, like
Code:
dd if=windowspart.image* of=/dev/hdb1
though I'm afraid that won't work either, but it is easily tested.

I think you'll need something like a for-loop in a bash script to feed dd. Have a look at
http://linux.org.mt/article/terminal
http://theory.uwinnipeg.ca/UNIXhelp/
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://www.tldp.org/guides.html#abs

That'll give you an idea ...
 
Old 12-13-2005, 09:43 AM   #5
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
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?
 
Old 12-13-2005, 10:03 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638

Rep: Reputation: Disabled
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.
 
Old 12-13-2005, 04:16 PM   #7
drt1245
LQ Newbie
 
Registered: Dec 2005
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
Old 12-14-2005, 04:35 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638

Rep: Reputation: Disabled
@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.
 
Old 12-14-2005, 05:32 AM   #9
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
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.
 
Old 12-14-2005, 05:44 AM   #10
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638

Rep: Reputation: Disabled
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?
 
Old 12-14-2005, 05:54 AM   #11
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
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?
 
Old 12-14-2005, 05:58 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,638

Rep: Reputation: Disabled
Quote:
Originally Posted by uberNUT69
...Which would you prefer?


No further comment .
 
Old 12-14-2005, 08:11 AM   #13
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
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
 
  


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
Kernel-image renamed to linux-image? powadha Debian 2 08-02-2005 06:07 AM
Creating/restoring drive image on USB drive OneSeventeen Linux - Newbie 9 07-06-2005 06:08 AM
NIC wont get IP after restoring image.. slug420 Linux - General 2 01-13-2005 08:18 AM
Best image viewer for very large image files? andvaranaut Linux - Software 1 02-21-2004 11:01 AM
Slightly OT : Restoring Drive Image to Resized Partition dlocalized Linux - Newbie 10 11-28-2003 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:50 AM.

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
Open Source Consulting | Domain Registration