FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Wed May 12, 2021 01:33



Post new topic Reply to topic  [ 3 posts ] 
Mark sectors as bad - or ntfscluster -s ? 
Author Message

Joined: Thu Jan 11, 2007 21:34
Posts: 77
Post Mark sectors as bad - or ntfscluster -s ?
Hi,

I'm rescuing a 500 GB HDD with many bad blocks (I assume 2000-5000 bad blocks).
I already copied 450 GB from it to a fresh device using ddrescue, which can even be mounted (ro; using kpartx -r -a and ntfs-3g -o ro)

Now my question: Luckily, ddrescue gives me a list of bad sectors. Can I import them into the file system so that ntfs-3g refuses access to files which are mapped to bad sectors? Alternatively, is there a way to give ntfs-3g a list of bad sectors?

Or should I use ntfscluster to get the list of files which are in bad sectors?

The last resort will be to write a special bitpattern in the image where the badblocks at the original device are, copy everything and scan the files whether they have this bitpattern in it...


Sun Jan 17, 2016 22:48
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Mark sectors as bad - or ntfscluster -s ?
Hi,

Quote:
I already copied 450 GB from it to a fresh device using ddrescue, which can even be mounted

You had better run chkdsk on the new disk after the copy. With so many bad sectors, inconsistencies between files, directories and bitmap are likely.
Also mounting both disks at the same time may lead to problems as they will show the same uuid. Use ntfslabel to generate a new label for the new disk.
Quote:
Now my question: Luckily, ddrescue gives me a list of bad sectors. Can I import them into the file system so that ntfs-3g refuses access to files which are mapped to bad sectors? Alternatively, is there a way to give ntfs-3g a list of bad sectors?

No such way currently. Anyway, what are you trying to do ? Your new disk has supposedly no defect, so marking sectors as bad is meaningless. What would be the purpose of the tool you would like to have ?
Quote:
Or should I use ntfscluster to get the list of files which are in bad sectors?

This should work if your intention is to just delete the bad files and free the space accordingly. You will probably have to build a shell script to automate the process.
Quote:
The last resort will be to write a special bitpattern in the image where the badblocks at the original device are, copy everything and scan the files whether they have this bitpattern in it...

I do not get it. Would this be just another way to make the list of bad sectors ?

If your intention is to weed out bad files, you can also copy all files from the old disk (mounted read-only) and kill those which cannot be copied.

Regards

Jean-Pierre


Mon Jan 18, 2016 15:22
Profile

Joined: Thu Jan 11, 2007 21:34
Posts: 77
Post Re: Mark sectors as bad - or ntfscluster -s ?
I don't want to access the old broken harddisk by any other tool than ddrescue or other low level tools - partly because the HDD can read some sectors, but very, very slow (up to minutes), and I don't know how the filesystem driver can cope with this. Same goes for chkdsk etc. Additionally, I've some flacky sectors (can be read sometimes but not everytime)

But this way, I loose the information which sectors were defective. In the meantime, I managed to find an option from ddresue (fill-mode) which can fill all sectors which couldn't be copied.

Yeah, I'll do a (read-only) chkdsk on the copy to get an idea how much of the metadata is lost - but I've the feeling that at least the complete MFT is rescued (I could copy several 100 MB from the start of the MFT).

I use the new harddisc (or better this partition, which holds the (almost) complete 1:1 copy of the old harddisc) only as a temporary copy - I'll copy the rescued files to another location on a fresh filesystem. I could even use plain photorec - but I thought that using the ntfs-metadata I get also fragmented files, and also the original file structure. And I don't stumble over already deleted files ;-)


Sun Jan 24, 2016 17:09
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.