1. HDD 인식되는지 확인
jkpark@cactus:~$ sudo fdisk -l
Disk /dev/sdb: 1.8 TiB, 2000365289472 bytes, 3906963456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00021365
Device Boot Start End Sectors Size Id Type
/dev/sdb1 4096 3906963455 3906959360 1.8T 83 Linux
새HDD의 경우 파티션설정과 포맷을 해야하지만,
이미 파일시스템이 있는 HDD를 인식한 것이기 때문에 파티션설정과 포맷은 생략한다.
2. 마운트할 UUID 확인
jkpark@cactus:~$ ls -l /dev/disk/by-uuid/
합계 0
lrwxrwxrwx 1 root root 10 12월 28 21:00 6defc19e-35d6-43a9-92c4-7240a90cc914 -> ../../sdb1
3. 마운트할 경로
jkpark@cactus:~$ sudo mkdir /storages
jkpark@cactus:~$ cd /storages/
jkpark@cactus:/storages$ sudo mkdir storage1
4. fstab 편집
jkpark@cactus:/storages$ sudo vi /etc/fstab
...
# /storages/storage1 was pm /dev/sdb1, jkpark mounted
UUID=6defc19e-35d6-43a9-92c4-7240a90cc914 /storages/storage1 ext4 defaults 0 1
5. 마운트 확인
jkpark@cactus:/storages$ sudo mount -a
jkpark@cactus:/storages$ ls storage1/
public
jkpark@cactus:/storages$
6. 권한변경
jkpark@cactus:/storages$ sudo chown jkpark:jkpark storage1/
jkpark@cactus:/storages$ ls -al
합계 12
drwxr-xr-x 3 root root 4096 12월 28 21:11 .
drwxr-xr-x 25 root root 4096 12월 28 21:10 ..
drwxr-xr-x 3 jkpark jkpark 4096 11월 16 16:35 storage1
jkpark@cactus:/storages$
7. 확인
jkpark@cactus:/storages$ df -h
Filesystem Size Used Avail Use% Mounted on
...
/dev/sdb1 1.8T 199G 1.6T 12% /storages/storage1
jkpark@cactus:/storages$