読者です 読者をやめる 読者になる 読者になる

HDD増設 (Ubuntu Server 14.04)

やるたびにググってるのでメモ。
ちなみに増設したのは3TBのHDD。
/dev/sdc とかは適宜。

$ sudo parted /dev/sdc
GNU Parted 2.3
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: /dev/sdc: unrecognised disk label
(parted) mklabel
New disk label type? gpt
(parted) mkpart
Partition name?  []?
File system type?  [ext2]? ext4
Start? 0
End? 3001GB
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i
(parted) quit
Information: You may need to update /etc/fstab.
$ sudo mkfs.ext4 /dev/sdc1
mke2fs 1.42.9 (4-Feb-2014)
/dev/sdc1 alignment is offset by 3072 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Filesystem label=
OS type: Linux
*snip*
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
$ sudo blkid /dev/sdc1
/dev/sdc1: UUID="hogehoge" TYPE="ext4"
$ sudo vim /etc/fstab
次の行を追加
UUID=hogehoge /path/to/mount/point ext4 defaults 0 0
$ mkdir /path/to/mount/point
$ sudo mount -a
$ df -h
Filesystem              Size  Used Avail Use% Mounted on
*snip*
/dev/sdc1               2.7T   73M  2.6T   1% /path/to/mount/point