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

Next revision
Previous revision
computing:storage:disk_prep_test [2011/11/08 08:34]
gcooper created
computing:storage:disk_prep_test [2018/01/17 10:32] (current)
gcooper
Line 14: Line 14:
  
 Disks support smart? Disks support smart?
-sudo smartctl -i /dev/sdf+<file> 
 +sudo smartctl -i /dev/sdX
  
 +</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 ====
  
-Non-destructive read/write disk/partition test:+:!: 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'
 + 
 +=== Determine Optimal Block Size === 
 <file> <file>
-sudo badblocks -nvs /dev/sdf +tune2fs -/dev/sdX1 | grep Block
-sudo badblocks -nvs /dev/sdf1+
 </file> </file>
  
-Destructive test (best) (10K blocks for speed):+=== Non-Destructive Test === 
 + 
 +Read/write test a disk/partition: 
 <file> <file>
-sudo badblocks -wvs -Amazon - AWS 10240 /dev/sdf+sudo badblocks -nvs /dev/sdX                # entire disk 
 +sudo badblocks -nvs /dev/sdX1               # partition only 
 +</file>
  
 +=== Destructive Test ===
 +
 +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>
 +sudo badblocks -wvs -b 4096 /dev/sdX | tee badblocks.txt
 </file> </file>
 +
 ===== Preparation ===== ===== Preparation =====
  
Line 59: 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 -Amazon - AWS "cat /dev/zero > /dev/sdf"+sudo sh -"cat /dev/zero > /dev/sdX"
 </file> </file>
  
Line 71: Line 91:
 Partition a drive: Partition a drive:
 <file> <file>
-sudo fdisk /dev/sdf+sudo fdisk /dev/sdX
 </file> </file>
  
Line 78: 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 90: Line 110:
 Linux EXT3: Linux EXT3:
 <file> <file>
-sudo mkfs.ext3 /dev/sdf1+sudo mkfs.ext3 /dev/sdX1
 </file> </file>
  
Line 96: 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.1320766449.txt.gz · Last modified: 2011/11/08 08:34 by gcooper