Add a drive: Difference between revisions
No edit summary  | 
				No edit summary  | 
				||
| Line 1: | Line 1: | ||
To add a new drive:  | To add a new drive using fdisk (these steps didn't work when drive >2TB):  | ||
 su -  | |||
 # choose gpt format  | |||
 parted /dev/sdf mklabel gpt  | |||
 # create primary partition, filling all space  | |||
 parted -a opt /dev/sdf mkpart primary ext4 0% 100%  | |||
 # format as ext4  | |||
 # for data drives only: use [-m 0], it's very important; without it, goofy ext4 wastes 5% "saved for root" wtf  | |||
 mkfs.ext4 -m 0 -L hare-s3-4t /dev/sdf1  | |||
# mount /dev/sdf1 /somewhere # make sure it looks good!  | |||
# install smartctl tools  | |||
 smartctl -c /dev/sdf # to peek at available tests and how long they typically take to run  | |||
 smartctl -t short /dev/sdf  | |||
 watch -n 3 smartctl -l selftest /dev/sdf # until success, takes about 1 minute  | |||
# if you're feeling ambitious, rerun with [-t long]  | |||
# umount # we are NOT going to be manually mounting!  we need to label the drive and put it in /etc/fstab  | |||
# emacs /etc/fstab - and put in an entry like this:  | |||
 LABEL=hare-s3-4t /spiceflow/hare-s3-4t ext4 noatime 0 0  | |||
# mount /my-mount-location # now it will be there when you reboot!  but do this to get it NOW :-)  | |||
# Note that if you mount the new drive under /spiceflow, samba will already be serving it up, whoop!  | |||
OLD To add a new drive using fdisk (these steps didn't work when drive >2TB):  | |||
# ls /dev/sd* # and make note of what you have  | # ls /dev/sd* # and make note of what you have  | ||
# plug the new drive into a SATA socket  | # plug the new drive into a SATA socket  | ||
| Line 14: | Line 37: | ||
    w # write and quit  |     w # write and quit  | ||
# format: mkfs.ext4 -m 0 /dev/sdf1 # the [-m 0] is very important; without it, goofy ext4 wastes 5% "saved for root" wtf  | # format: mkfs.ext4 -m 0 /dev/sdf1 # the [-m 0] is very important; without it, goofy ext4 wastes 5% "saved for root" wtf  | ||
# e2label /dev/sdb1 box-type-sizename # what a stupid f'in name for that util  | # e2label /dev/sdb1 box-type-sizename # what a stupid f'in name for that util  | ||
Revision as of 22:56, 2 June 2019
To add a new drive using fdisk (these steps didn't work when drive >2TB):
su - # choose gpt format parted /dev/sdf mklabel gpt # create primary partition, filling all space parted -a opt /dev/sdf mkpart primary ext4 0% 100% # format as ext4 # for data drives only: use [-m 0], it's very important; without it, goofy ext4 wastes 5% "saved for root" wtf mkfs.ext4 -m 0 -L hare-s3-4t /dev/sdf1
- mount /dev/sdf1 /somewhere # make sure it looks good!
 - install smartctl tools
 
smartctl -c /dev/sdf # to peek at available tests and how long they typically take to run smartctl -t short /dev/sdf watch -n 3 smartctl -l selftest /dev/sdf # until success, takes about 1 minute
- if you're feeling ambitious, rerun with [-t long]
 - umount # we are NOT going to be manually mounting! we need to label the drive and put it in /etc/fstab
 - emacs /etc/fstab - and put in an entry like this:
 
LABEL=hare-s3-4t /spiceflow/hare-s3-4t ext4 noatime 0 0
- mount /my-mount-location # now it will be there when you reboot! but do this to get it NOW :-)
 - Note that if you mount the new drive under /spiceflow, samba will already be serving it up, whoop!
 
OLD To add a new drive using fdisk (these steps didn't work when drive >2TB):
- ls /dev/sd* # and make note of what you have
 - plug the new drive into a SATA socket
 - ls /dev/sd* # you should now see something new, like [/dev/sdf]
 - or do: cat /var/log/messages|grep sd # to see what it used
 - fdisk looks good again...
 
fdisk /dev/sdg p # to show what is there already, hopefully nothing (d if needed to delete existing partitions) n # new 1 # partition 1 <enter> # for default of 2048 <enter> # for default, end of drive w # write and quit
- format: mkfs.ext4 -m 0 /dev/sdf1 # the [-m 0] is very important; without it, goofy ext4 wastes 5% "saved for root" wtf
 - e2label /dev/sdb1 box-type-sizename # what a stupid f'in name for that util