Linux - GeneralThis 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
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.
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.
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 ?.
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.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.