User Tools

Site Tools


computing:storage:disk_prep_test

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computing:storage:disk_prep_test [2012/04/30 11:10]
gcooper
computing:storage:disk_prep_test [2018/01/17 10:32] (current)
gcooper
Line 15: Line 15:
 Disks support smart? Disks support smart?
 <file> <file>
-sudo smartctl -i /dev/sdf+sudo smartctl -i /dev/sdX
  
 </file> </file>
 Show disk info: Show disk info:
 <file> <file>
-sudo smartctl -a /dev/sdf+sudo smartctl -a /dev/sdX
 </file> </file>
  
 Enable smart: Enable smart:
 <file> <file>
-sudo smartctl -s on -d ata /dev/sdf+sudo smartctl -s on -d ata /dev/sdX
 </file> </file>
  
 Initiate quick health check: Initiate quick health check:
 <file> <file>
-sudo smartctl -d ata -H /dev/sdf+sudo smartctl -d ata -H /dev/sdX
 </file> </file>
  
 Initiate extended self test: Initiate extended self test:
 <file> <file>
-sudo smartctl -d ata -t long /dev/sdf+sudo smartctl -d ata -t long /dev/sdX
 </file> </file>
 then then
 <file> <file>
-sudo smartctl -l selftest /dev/sdf+sudo smartctl -l selftest /dev/sdX
 </file> </file>
  
 ==== Badblocks ==== ==== Badblocks ====
  
-:!: Badblocks can be hazardous to your data.  Make a backup first!+:!: Badblocks can be hazardous to your data.  **Make a backup first!** 
 + 
 +:!: Running ''badblocks'' on **SSDs** may **reduce lifespans**.
  
 There are some valid circumstances where you have to use the '-f' switch to force the testing.  Be careful when doing so to make sure you 'do no harm'. There are some valid circumstances where you have to use the '-f' switch to force the testing.  Be careful when doing so to make sure you 'do no harm'.
Line 51: Line 53:
  
 <file> <file>
-tune2fs -l /dev/sdf1 | grep Block+tune2fs -l /dev/sdX1 | grep Block
 </file> </file>
  
Line 59: Line 61:
  
 <file> <file>
-sudo badblocks -nvs /dev/sdf                # entire disk +sudo badblocks -nvs /dev/sdX                # entire disk 
-sudo badblocks -nvs /dev/sdf1               # partition only+sudo badblocks -nvs /dev/sdX1               # partition only
 </file> </file>
  
 === Destructive Test === === Destructive Test ===
  
-This is the best test and uses 4096K blocks for improved speed and saves a log file of bad blocks:+This is the best test and uses 4096K blocks for improved speed and saves a log file of bad blocks (add f to -wvs to force if drive reports in use):
  
 <file> <file>
-sudo badblocks -wvs -b 4096 /dev/sdf | tee badblocks.txt+sudo badblocks -wvs -b 4096 /dev/sdX | tee badblocks.txt
 </file> </file>
  
Line 77: Line 79:
 Write zeros to disk (best for making compressible images) (also wipes out MBR): Write zeros to disk (best for making compressible images) (also wipes out MBR):
 <file> <file>
-sudo sh -c "cat /dev/zero > /dev/sdf"+sudo sh -c "cat /dev/zero > /dev/sdX"
 </file> </file>
  
Line 89: Line 91:
 Partition a drive: Partition a drive:
 <file> <file>
-sudo fdisk /dev/sdf+sudo fdisk /dev/sdX
 </file> </file>
  
Line 96: Line 98:
 Write a DOS MBR (like fdisk /MBR) (may need --force) Write a DOS MBR (like fdisk /MBR) (may need --force)
 <file> <file>
-sudo install-mbr /dev/sdf -v --interrupt n --partition D --timeout 0+sudo install-mbr /dev/sdX -v --interrupt n --partition D --timeout 0
 </file> </file>
  
 Note: the syslinux package also includes a mbr.bin file: Note: the syslinux package also includes a mbr.bin file:
 <file> <file>
-sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdf+sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX
 </file> </file>
  
Line 108: Line 110:
 Linux EXT3: Linux EXT3:
 <file> <file>
-sudo mkfs.ext3 /dev/sdf1+sudo mkfs.ext3 /dev/sdX1
 </file> </file>
  
Line 114: Line 116:
 Partition the flash device as 'W95 FAT32' and set the 'bootable' flag if desired. Partition the flash device as 'W95 FAT32' and set the 'bootable' flag if desired.
 <file> <file>
-sudo mkdosfs -F 32 /dev/sdf1+sudo mkdosfs -F 32 /dev/sdX1
 </file> </file>
 or or
 <file> <file>
-sudo mkfs.vfat -F 32 /dev/sdf1+sudo mkfs.vfat -F 32 /dev/sdX1
  
 </file> </file>
  
computing/storage/disk_prep_test.1335805823.txt.gz · Last modified: 2012/04/30 11:10 by gcooper