LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-21-2012, 04:42 PM   #1
NetRAVEN5000
Member
 
Registered: May 2005
Distribution: Ubuntu 9.04
Posts: 320

Rep: Reputation: 30
Please Help - restoring a backup


OK, so here's what happened. My mom's computer is always having trouble so I decided I'd put Linux on it.

I backed up her Windows partition, and then I resized it. Apparently I did something wrong when resizing it and her data isn't there.

I'm having trouble figuring out how to restore the backup. I've got a 300GB or so file that I created using "ntfsclone" but trying to restore from this file is giving me errors.

Did I do something wrong? Please help?
 
Old 12-21-2012, 05:05 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Significant lack of required detail.
- how did you backup the partition ?. The exact command.
- how did you resize it. Ditto above. Did you resize under Windoze or Linux - which tool ?.
- how do you know the data isn't there - does Windoze still boot, did you mount the NTFS in Linux, what ....?
- is the ntfsclone file mountable on a loop device so you can check the (now missing) data there.

Did you read the caveats in the ntfsclone manpage ?.
 
Old 12-21-2012, 06:06 PM   #3
NetRAVEN5000
Member
 
Registered: May 2005
Distribution: Ubuntu 9.04
Posts: 320

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by syg00 View Post
Significant lack of required detail.
- how did you backup the partition ?. The exact command.
I backed up the partition using ntfsclone. As far as the exact command - I don't know, but I think it was something like ntfsclone --rescue -o mombkup /dev/sda1

Quote:
- how did you resize it. Ditto above. Did you resize under Windoze or Linux - which tool ?.
Sorry, don't remember the exact command but I used ntfsresize - which said that it went OK, but then it said I would have to resize the partition using parted which I figure is probably where I screwed this part up. The directions I followed said to delete the partition and create a new one.

Quote:
- how do you know the data isn't there - does Windoze still boot, did you mount the NTFS in Linux, what ....?
Windows does not boot. The NTFS partition will mount but is empty.

I should say, I ran gpart from GPartEd (the gui version of parted) after yanking the drive out and putting it in my main PC - gpart was able to find another partition but it couldn't get me to where I could actually see what's there.

Quote:
- is the ntfsclone file mountable on a loop device so you can check the (now missing) data there.
No, I am getting I/O errors trying to mount it.

Quote:
Did you read the caveats in the ntfsclone manpage ?.
Probably should've. Nope.

I should add - this disk has bad sectors so in retrospect this was probably a bad idea in the first place but I didn't think of that until later.
 
Old 12-21-2012, 06:25 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Ugh. I was presuming you had a good source, and a decent backup.
What you attempted would have been reasonable in that case - I'm not so sure you can get anywhere now. Especially with it being NTFS. The ntfsprogs toolset (including both ntfsclone and ntfsresize) are very good, but were developed without any help from M$oft.
I've never attempted to use them on a dodgy filesystem.

After the resize, which only does the filesystem, the partition still contains the free space - that's why it needs to be resized separately. NOT deleted/reallocated which would delete the recently resized filesystem altogether (Gparted does both resize functions for you automagically - one of it's best features).
Had you stopped there, you would have been able to get things back as they were. I presume you added (formatted) NTFS on that new partition. Not good.
You might be able to scrape some of the files, but with bad sectors as well as a reformat, I don't like your chances. The fact you can't mount the backup is a bad sign as well.

Hopefully someone else can offer better prospects.
 
Old 12-21-2012, 06:26 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,502

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Which version of windows was on the computer?
You said you decided to put Linux on the computer. Did you? Was the installation successful? or did you not install it yet? Do you have a Linux installation CD/DVD?

Quote:
The directions I followed said to delete the partition and create a new one.
Which partition? The partition you had windows on? That doesn't make sense? If you resized, your windows partition should have been smaller and you should have had unallocated space on which to create a new partition and format it with a Linux filesystem.

From the info in your last post, it looks like the windows partition is gone or unusable. Hopefully you will be able to restore from your backup and someone familiar with ntfsclone will come along to assist.
 
Old 12-22-2012, 08:48 AM   #6
NetRAVEN5000
Member
 
Registered: May 2005
Distribution: Ubuntu 9.04
Posts: 320

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by yancek View Post
Which version of windows was on the computer?
You said you decided to put Linux on the computer. Did you? Was the installation successful? or did you not install it yet? Do you have a Linux installation CD/DVD?
It is Windows Vista. 32-bit.

I was going to put Ubuntu on the computer, but I needed to resize the partitions before I could do that. So, I have not installed it yet. I do have a USB drive to install it from.

Quote:
Which partition? The partition you had windows on? That doesn't make sense? If you resized, your windows partition should have been smaller and you should have had unallocated space on which to create a new partition and format it with a Linux filesystem.
The only other partition is HP's recovery partition.
 
Old 12-26-2012, 01:01 PM   #7
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
I think you're heading for a recovery excercise; when booted from the Ubuntu liveCD/liveUSB, you can install testdisk/photorec from the repositories and see if you can recover the data from the harddisk; have an external HD handy to save the files.

A little late:
Before resizing partitions, it's very advisable to defrag them.
 
Old 12-26-2012, 01:26 PM   #8
NetRAVEN5000
Member
 
Registered: May 2005
Distribution: Ubuntu 9.04
Posts: 320

Original Poster
Rep: Reputation: 30
Thanks for the help, everyone.

I was not able to recover the partition but I was able to recover the files using PhotoRec. They're on my external drive now, now it's just a matter of looking through to see what is and isn't important.

@Wim -
Quote:
Before resizing partitions, it's very advisable to defrag them.
Good to know although this Windows install would most likely have crashed before the defrag completed, which is why I was going to try Linux.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
restoring an rsync backup Cultist Linux - Software 1 07-10-2011 08:18 AM
restoring a backup rholme Linux - Newbie 10 07-09-2009 01:07 PM
Restoring from Suse Backup tictoc SUSE / openSUSE 9 02-09-2009 04:18 AM
Restoring from an rsync backup of / eldoran Linux - General 3 04-25-2006 11:34 PM
Restoring backup dominique Linux - Newbie 3 12-06-2001 02:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11: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