LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 03-02-2009, 05:55 PM   #1
cristiano.fava
LQ Newbie
 
Registered: Mar 2009
Distribution: Ubuntu 8.10
Posts: 3

Rep: Reputation: 0
ntfs partition on usb disk messed up by gparted needs recovery


Hi all!
I was trying to resize and move an ntfs partition on usb external hd with gparted on Ubuntu 8.10 .
The operation finished with an error:
(...)
updating bootsector of ntfs filesystem on /dev/sdb1 00:00:00 ( SUCCESS )
echo 3f000000 | /usr/bin/xxd -r -p | /bin/dd conv=notrunc of=/dev/sdb1 bs=1 seek=28
4+0 records in
4+0 records out
4 bytes (4 B) copied, 0.000135352 s, 29.6 kB/
check filesystem on /dev/sdb1 for errors and (if possible) fix them 00:00:00 ( ERROR )
ntfsresize -P -i -f -v /dev/sdb1
ntfsresize v2.0.0 (libntfs 10:0:0)
ERROR: Device '/dev/sdb1' is mounted read-write. You must 'umount' it first.
.
Now the partition is not mountable and appears to have a corrupted partition table:
root@cribuntu:~# fdisk -l /dev/sdb
Disk /dev/sdb: 251.0 GB, 251000193024 bytes
255 heads, 63 sectors/track, 30515 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0005f72d

Device Boot Start End Blocks Id System
/dev/sdb1 1 1057 8490321 7 HPFS/NTFS
root@cribuntu:~# fdisk -l /dev/sdb1

Disk /dev/sdb1: 8694 MB, 8694088704 bytes
255 heads, 63 sectors/track, 1056 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/sdb1 doesn't contain a valid partition table
.
How to recover this situation ???
I can recover files with scrounge-ntfs but I would like to recover the partition.
 
Old 03-02-2009, 06:28 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Try using testdisk.
 
Old 03-03-2009, 05:19 PM   #3
cristiano.fava
LQ Newbie
 
Registered: Mar 2009
Distribution: Ubuntu 8.10
Posts: 3

Original Poster
Rep: Reputation: 0
almost solved

Testdisk could not repair anything.
The utility scrounge-ntfs could not recover most of the files
(almost all with length 0).
At the end, I tried this:

# made another ntfs filesystem on the same partition:
mkfs.ntfs -f -n -p 63 -c 4096 /dev/sdb1
# resized partition to the original value (dimension from gparted log)
(used gparted interface -> resize)
#resized filesystem to match the original dimension:
ntfsresize -P --force --force /dev/sdb1 -s 199232699903

Now using scrounge I CAN recover most of files (or all...the recovering
is still not finished).
Not a perfect solution since all files are copied to a single directory
without order but I can recover my files.
This is the best I could do....damn gparted!!!!
 
Old 03-03-2009, 06:03 PM   #4
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,743

Rep: Reputation: 196Reputation: 196
Maybe next time

I like to use a Parted Magic live-cd which has a copy of GParted on it and the ROX terminal program where I can use the command fdisk or cfdisk to manage partitions measured in cylinders.
 
Old 03-04-2009, 04:34 PM   #5
cristiano.fava
LQ Newbie
 
Registered: Mar 2009
Distribution: Ubuntu 8.10
Posts: 3

Original Poster
Rep: Reputation: 0
I discovered that ALL files contains messed up bytes!
Only Mp3 seems to be readable and play good ; all other files (iso, zip, ppt and so on) have the wrong sequence of bytes....sigh!
It appears that scrounge restored files with the correct size and name but the wrong sequence of bytes. Perhaps this was the original error of
gparted that tried to move the partition at the beginning of the disk.
I finished with a bunch of stupid mp3 and lost all my data...
If some guru can give an idea to recover files, please post a note now because tomorrow I will reformat the disk in ext3!!!.
Thanks.
 
Old 03-05-2009, 04:29 PM   #6
thorkelljarl
Senior Member
 
Registered: Jun 2008
Posts: 1,743

Rep: Reputation: 196Reputation: 196
For next time...

For Xp, you can move the upper limit of the Windows partition with a linux partitioning tool after you have defragmented Windows.

For Vista, you should use Vistas own partitioning tool to move the upper limit of the Windows partition. Vista does not have a defragmentation utility.

In both instances use a linux partitioning tool thereafter to format for linux.

It is possible with any partitioner to shift a partitions limits down so much that the result removes a portion of the partition containing data that was there. That is the reason for defragmentation, which in Windows groups the files at the beginning of the partition.

I like to check, if I practically can, what I have for partitions and where they by using a partitioning tool that gives me the information in cylinders before I do anything.

I do not like or trust partitioners and their automatic actions when they want to clear and partition a given number of GBs as part of doing a linux installation when there is another installation on the HDD that has to survive the process.
 
Old 03-09-2009, 09:45 AM   #7
faiselm
LQ Newbie
 
Registered: Mar 2009
Posts: 2

Rep: Reputation: 0
total newbie needs help recovering data

Hi All,

I was using windows xp when i got hit by a trojan and erased system files. as a result, my computer crashed completely. A friend suggested that I load linux on my hard drive and then I would be able to recover my files on the hdd. upon installing ubuntu 8.10 over the hdd, i found to my dismay that I had lost all my files and folders.

Is there any way to retrieve those files that were previously on the windows partition? note that the whole hdd is linux ...

hoping that there are some gurus who can give a dummy advice.
 
Old 03-09-2009, 09:54 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
faiselm;

I closed your other thread before I saw this. I will re-open the other thread.

I suggest you edit out the content of this post---it really does not fit in this thread.
 
Old 03-09-2009, 11:02 AM   #9
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by thorkelljarl View Post
Vista does not have a defragmentation utility.
just fyi.. Vista Defrag how-to

although lately I've become a fan of this free Defrag utility from auslogics

Last edited by farslayer; 03-09-2009 at 11:23 AM.
 
  


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
Error trying to resize NTFS partition with Gparted mistere29 Linux - Newbie 6 06-14-2009 06:20 PM
redimension a ntfs partition using gparted htamayo Linux - Software 1 04-12-2007 11:55 AM
Gparted refuses to resize NTFS (3G) partition, even if it has been unmounted. PureRumble Linux - Software 9 04-02-2007 08:02 PM
error resizing NTFS partition with gParted live CD Nived87 Linux - Newbie 5 05-29-2006 02:53 AM
Data Recovery from former NTFS partition exark237 Linux - Hardware 3 07-21-2004 07:27 PM


All times are GMT -5. The time now is 07:31 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration