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 |
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
03-02-2009, 04:55 PM
|
#1
|
|
LQ Newbie
Registered: Mar 2009
Distribution: Ubuntu 8.10
Posts: 3
Rep:
|
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.
|
|
|
|
03-02-2009, 05:28 PM
|
#2
|
|
Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092
|
Try using testdisk.
|
|
|
|
03-03-2009, 04:19 PM
|
#3
|
|
LQ Newbie
Registered: Mar 2009
Distribution: Ubuntu 8.10
Posts: 3
Original Poster
Rep:
|
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!!!!
|
|
|
|
03-03-2009, 05:03 PM
|
#4
|
|
Senior Member
Registered: Jun 2008
Posts: 1,631
Rep: 
|
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.
|
|
|
|
03-04-2009, 03:34 PM
|
#5
|
|
LQ Newbie
Registered: Mar 2009
Distribution: Ubuntu 8.10
Posts: 3
Original Poster
Rep:
|
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.
|
|
|
|
03-05-2009, 03:29 PM
|
#6
|
|
Senior Member
Registered: Jun 2008
Posts: 1,631
Rep: 
|
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.
|
|
|
|
03-09-2009, 08:45 AM
|
#7
|
|
LQ Newbie
Registered: Mar 2009
Posts: 2
Rep:
|
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.
|
|
|
|
03-09-2009, 08:54 AM
|
#8
|
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,797
|
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.
|
|
|
|
03-09-2009, 10:02 AM
|
#9
|
|
Guru
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Rep: 
|
Quote:
Originally Posted by thorkelljarl
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 10:23 AM.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:07 PM.
|
|
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
|
|