Format

From OnnoWiki
Jump to navigation Jump to search

Format USB flashdisk / USB harddisk / harddisk dapat menggunakan

mkfs

Catatan penggunaan:

Usage: mkfs [options] [-t type fs-options] device [size] 

Options:
 -t, --type=TYPE  file system type, when undefined ext2 is used
     fs-options   parameters to real file system builder
     device       path to a device
     size         number of blocks on the device
 -V, --verbose    explain what is done
                  defining -V more than once will cause a dry-run
 -V, --version    output version information and exit
                  -V as version must be only option
 -h, --help       display this help and exit 
For more information see mkfs(8).


atau

Usage: mkfs.ext3 [-c|-l filename] [-b block-size] [-C cluster-size]

[-i bytes-per-inode] [-I inode-size] [-J journal-options] [-G flex-group-size] [-N number-of-inodes] [-m reserved-blocks-percentage] [-o creator-os] [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] [-O feature[,...]] [-r fs-revision] [-E extended-option[,...]] [-t fs-type] [-T usage-type ] [-U UUID] [-jnqvDFKSV] device [blocks-count]

Yang sederhana, misalnya.

mkfs.ext3  -J size=10000 -L repo /dev/sdb1


Cek Bed Blocks

Memformat sambil cek bed blocks

mkfs -L data -c /dev/sdb1


Menggunakan badblocks

Before Filesystem Creation

Alternately, this can be done before filesystem creation.

If badblocks is run without the -o option bad sectors will only be printed to stdout.

Example output for read errors in the beginning of the disk:

# badblocks -wsv /dev/<drive>

[...] Testing with pattern 0xff: done Reading and comparing: [...] 37584 37585 0.84% done, 7:31:08 elapsed. (0/0/527405 errors) 37586 [...] done Testing with pattern 0x00: Reading and comparing: [...] 37584 37585 [...] done Pass completed, 527405 bad blocks found. (0/0/527405 errors)

For comfortably passing badblocks error output to the filesystem it has to be written to a file.

# badblocks -wsv -o /root/<badblocks.txt> /dev/<device>

Checking for bad blocks in read-write mode From block 0 to 488386583 Testing with pattern 0xaa: done Reading and comparing: 6.36% done, 0:51 elapsed. (0/0/14713 errors) [...] Testing with pattern 0x00: done Reading and comparing: done Pass completed, 527405 bad blocks found. (0/0/527405 errors)

Then (re-)create the file system with the information:

# mkfs.<filesystem-type> -l /root/<badblocks.txt> /dev/<device>

Note: The meaning of 0/0/527405 errors is <number of read errors>/<number of write errors>/<number of corruption errors>.