The following is the GNU All-permissive License as recommended in https://www.gnu.org/licenses/license-recommendations.en.html

Copyright (C) 2024 Free Software Foundation sysadmin@fsf.org

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Contributions are welcome. See https://savannah.gnu.org/maintenance/fsf/.

[[!toc levels=2]]

Testing New and Old Disks

New disks need to be tested before production use. This policy applies for New and Used disks. Policy for testing new disks is as follows:

1) Plug the drive into the disk station located in the SysAdmin office. (ask a SysAdmin if you are unsure which machine this is).

2) See what new drive has been attached with the command: $ dmesg | tail

You will see something like:

[    2.291612] sd 2:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    2.291830] sd 2:0:0:0: [sda] Write Protect is off
[    2.291839] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.291905] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.334873]  sda: sda1 sda2

In this case, sda is the new drive.

3) Run badblocks against the harddrive:

badblocks -svw /dev/sda

  • -s Will enable the status display of the process.
  • -v Will enable the verbose display of the process.
  • -w Will enable the '''write''' test. Be aware, this will wipe the drive.

4) This process will take a long time (over three days for a 3TB disk). Wait until it completes. Failures will be indicated by the drive eitiher: Going off line -OR- Displaying known badblocks

  • If a drive passes the test, it goes in the server room in the box labled "Drives Ready to Use".
  • If the drive fails the first time being bad blocked, run badblocks again.
  • If the drive fails a second time and is new it is to be RMA'd.
  • If the drive fails a second and is old, follow the '''Disposing of Old Disks''' instructions below.

Disposing of Old Disks

Before an old spinning disk can be retired and recycled it must be purged. For drives >1.5TB please test it with the above '''Testing New/Old Disks''' instructions above (even if it has SMART errors).

1) Plug the drive into the disk station located in the SysAdmin office. (ask a SysAdmin if you are unsure which machine this is).

2) See what new drive has been attached with the command: $ dmesg | tail

You will see something like:

[    2.291612] sd 2:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    2.291830] sd 2:0:0:0: [sda] Write Protect is off
[    2.291839] sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.291905] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.334873]  sda: sda1 sda2

3) Shred the drive with random data (three passes) and a fourth pass of 0s to delete any signs of random wiping: shred -vz /dev/sda

  • -z Adds a fourth pass of 0s to hide traces of wiping.
  • -v Displays verbose output.

Using parted on disk greater than 2TB

formatting the disk for GPT

# parted /dev/sdg
GNU Parted 2.3
Using /dev/sdg
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel
New disk label type? gpt
(parted) print
Model: ATA WDC WD40EZRX-00S (scsi)
Disk /dev/sdg: 4001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

creating the partitions

(parted) mkpart 1 0G  500G
(parted) mkpart 2 500G  1000G
(parted) mkpart 3 1000G  1500G

setting up the raid flag

(parted) set 1 raid
New state?  [on]/off?

deleting the partitions

(parted) rm 3

calculate new partition size

if md8 has a missing disk:

md8 : active raid1 sdg6[3] sdn8[0] sdm8[2]
      227729280 blocks [3/2] [U_U]

check the size on one of the disk from the raid:

# mdadm -E /dev/sdm8
/dev/sdm8:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 00126a6b:629042e0:4dc1fa5f:b3880838 (local to host colonialone.fsf.org)
  Creation Time : Tue Dec 21 16:47:38 2010
     Raid Level : raid1
  Used Dev Size : 227729280 (217.18 GiB 233.19 GB)
     Array Size : 227729280 (217.18 GiB 233.19 GB)
   Raid Devices : 3
  Total Devices : 3
Preferred Minor : 8

    Update Time : Wed Mar 26 13:08:06 2014
          State : clean
 Active Devices : 2
Working Devices : 3
 Failed Devices : 1
  Spare Devices : 1
       Checksum : bafb094e - correct
         Events : 392890


      Number   Major   Minor   RaidDevice State
this     2       8      200        2      active sync   /dev/sdm8

   0     0       8      216        0      active sync   /dev/sdn8
   1     1       0        0        1      faulty removed
   2     2       8      200        2      active sync   /dev/sdm8
   3     3       8      102        3      spare   /dev/sdg6

'''233.19 GB''' in this case