LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Create XFS partition with bad block pr-echeck (https://www.linuxquestions.org/questions/linux-newbie-8/create-xfs-partition-with-bad-block-pr-echeck-4175665395/)

ddenial 12-04-2019 06:52 AM

Create XFS partition with bad block pr-echeck
 
Hello

I want to install CentOS 7 with the XFS filesystem. But I want to do pre-check for bad blocks before creating partitions. In ext4, there is a -c switch which will check for bad blocks before creating the filesystem. How do I do that for the XFS filesystem?

Thanks

berndbausch 12-04-2019 07:01 AM

There is a tool named badblocks. See, for example, https://www.tecmint.com/check-linux-...ors-bad-blocks or https://wiki.archlinux.org/index.php/Badblocks. Use badblocks before creating the filesystem.

ddenial 12-04-2019 08:01 AM

Quote:

Originally Posted by berndbausch (Post 6064584)
There is a tool named badblocks. See, for example, https://www.tecmint.com/check-linux-...ors-bad-blocks or https://wiki.archlinux.org/index.php/Badblocks. Use badblocks before creating the filesystem.

Thanks. I read the articles and from that what I understand is you first run badblocks with -o options which will create a text file with bad sector addresses, then use that text file with mkfs.ext4 -l <textfile> option. This will tell the formatting program to skip those addresses.

But the problem is, in mkfs.xfs, -l has a different meaning.

Quote:

$ man mkfs.ext4
-l filename
Read the bad blocks list from filename. Note that the block numbers in the bad block list must be generated using the same block size as used by mke2fs. As a result, the -c option to mke2fs is a much simpler and less error-prone method of checking a disk for bad blocks before formatting it, as mke2fs will automatically pass the correct parameters to the badblocks program.
Quote:

$ man mkfs.xfs
-l log_section_options
These options specify the location, size, and other parameters of the log section of the filesystem. The valid log_section_options are:

berndbausch 12-04-2019 08:17 AM

I must have been brain-dead when replying. To my knowledge, XFS doesn't have bad block treatment, although there seems to be a plan to include it in the future.


All times are GMT -5. The time now is 05:17 PM.