1

Topic: Ignore bad sectors

I think there should be an "ignore bad sectors" option. it would really help people that have bad sectors on thier hard disks, like me.

2

Re: Ignore bad sectors

krzysz00 wrote:

I think there should be an "ignore bad sectors" option. it would really help people that have bad sectors on thier hard disks, like me.

Add one more vote for that suggestion.

3 (edited by rpremuz 2010-01-21 17:17:34)

Re: Ignore bad sectors

I also vote for that option in GParted Live.

I wanted to expand an NTFS primary partition but the resize operation was unsuccessful because of bad sectors on the partition. I checked the partition with "chkdsk c: /r" in Windows XP and restarted twice but the problem remained. I'd say that in the case of partition expansion the bad sectors could be safely ignored.

-- rpr.

4

Re: Ignore bad sectors

I checked the partition with "chkdsk c: /r" in Windows XP restarted twice but the problem remained.

Did you try

chkdsk c: /f /r

?

GParted in general uses the safer switches for the various tools. ntfsresize (the tool that performs the ntfs resizing operations) is a command line tool that is able to ignore bad sector alerts. It is possible to run it from the command line with the right options to ignore bad sectors. However this is not the safe choice, that's why GParted didn't give it in the GUI.

Another reason to not include all possible options in the GParted GUI, is that it would be overloaded with many features that many users could not understand and that could be easy to set erroneously. This could cause serious problems, especially for non-experienced users.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

5 (edited by rpremuz 2010-01-21 17:17:00)

Re: Ignore bad sectors

class413 wrote:

Did you try

chkdsk c: /f /r

On Windows XP "chkdsk /?" says:
  /F Fixes errors on the disk.
  /R Locates bad sectors and recovers readable information (implies /F)
and so "chkdsk c: /r" is equivalent to "chkdsk c: /f /r".

GParted in general uses the safer switches for the various tools. ntfsresize (the tool that performs the ntfs resizing operations) is a command line tool that is able to ignore bad sector alerts. It is possible to run it from the command line with the right options to ignore bad sectors. However this is not the safe choice, that's why GParted didn't give it in the GUI.

Another reason to not include all possible options in the GParted GUI, is that it would be overloaded with many features that many users could not understand and that could be easy to set erroneously. This could cause serious problems, especially for non-experienced users.

I understand that I could use ntfsresize from command line but it is quite more complicated and hence I use the GUI.
I didn't ask for overloading the GUI with many features but just for "ignore bad sectors" option.

-- rpr.

6

Re: Ignore bad sectors

One way to get around this is to do the following:
PATH=.:$PATH
pushd /sbin; mv ntfsresize ntfsresize.orig; popd
cat > ntfsresize
#!/bin/sh

OUT="ntfsresize.out"
echo "Args: $*" >> $OUT
/sbin/ntfsresize.orig -b $* >> $OUT 2>&1
echo "Done" >> $OUT
Ctrl-d
chmod +x ntfsresize
Now run gparted from this shell and it will call the ntfsresize shell script created above which will add the ignore-bad-sector flag (-b) to arguments supplied and call ntfsresize.orig and redirect all output to ntfsresize.out.