1

I just got a QNAP TS-251, an NAS that runs Linux plus the manufacturer's tools. One of the setup options is to run a bad block scan, but on a pair of 4 TB drives that might take a really long time to run, during which I can't start to use my new NAS.

So, is there a utility that I can run in the background once the device is fully functional? Obviously such a utility would take even longer than one that's running on new, empty drives, since it has to do its thing without destroying live data. But meanwhile the machine is functional and available.

Such a utility might also be useful as a periodic preventive maintenance tool, a few times a year, not just as a way to bring a new device into service sooner.

  • Does such a utility exist for Linux in general?
  • If so, does it run on a QNAP NAS?
  • Or is there a QNAP specific utility for this purpose?
2
  • 1
    No a bad blocks search should be performed when the process can obtain exclusive access to the disk, so generally speaking, the disk should be unmounted at time of scan. This is because even when mounted as readonly, the process may cause kernel panics or damage the filesystem. see the notes on -f here: linux.die.net/man/8/badblocks – Frank Thomas Feb 26 '16 at 2:16
  • 1
    Last time I built up a NAS, I did check the SMART data and performed a filesystem check with free-space testing on each of the disks before using them, and good think I did as disk 2 needed to be RMA'd. I use JBOD though, so I did the testing on another PC, and then installed each disk to the NAS as it became ready. even if you plug it into a windows system, format it NTFS and run chkdsk on it, you can always let the QNAS reformat it natively when you are sure the new disk is healthy. – Frank Thomas Feb 26 '16 at 2:19
0

Since you tagged badblocks in your question, I assume you have some measure of familiarity with it. It can be run as a part of the e2fsck program used to check Ext2/3/4 filesystems if the underlying partitions on the NAS use that filesystem:

e2fsck -c /dev/blockDeviceHere
1
  • I don't know e2fsck very well, and I seem to remember that the BSD fsck I used many years ago tended to start over frequently if there was any write activity on the drive. Also, I see that the man page says, "If e2fsck asks whether or not you should check a filesystem which is mounted, the only correct answer is ''no''." – Steve Feb 25 '16 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.