홈서버에 삽질삽질 하여 3테라 하드를 마운트를 시켜놓으니 기본적으로 2T만 사용 가능하다고 합니다.

2테라 이상 사용하기 위해서는 ext4 포멧을 사용해야 하며 gpt라벨을 사용해야 3TB하드를 사용할 수 있다고 합니다.


$ sudo fdisk -l


Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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

Disk identifier: 0x0001734c


   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048      499711      248832   83  Linux

/dev/sda2          501758   976771071   488134657    5  Extended

/dev/sda5          501760   976771071   488134656   8e  Linux LVM


Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes

90 heads, 3 sectors/track, 21705678 cylinders, total 5860533168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x51e97a40


   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1            2048  4294967294  2147482623+  83  Linux


Disk /dev/mapper/????--vg-root: 495.6 GB, 495640903680 bytes

255 heads, 63 sectors/track, 60258 cylinders, total 968048640 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

Disk identifier: 0x00000000


Disk /dev/mapper/????--vg-root doesn't contain a valid partition table


Disk /dev/mapper/????--vg-swap_1: 4156 MB, 4156555264 bytes

255 heads, 63 sectors/track, 505 cylinders, total 8118272 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

Disk identifier: 0x00000000


Disk /dev/mapper/????--vg-swap_1 doesn't contain a valid partition table


하드1 (SDA) 500GB

하드2 (SDB) 3000GB - 3T

잘 인식 되어있는데...


$ df -h

Filesystem                   Size  Used Avail Use% Mounted on

/dev/mapper/????--vg-root  455G  1.7G  430G   1% /

none                         4.0K     0  4.0K   0% /sys/fs/cgroup

udev                         1.9G   12K  1.9G   1% /dev

tmpfs                        383M  536K  383M   1% /run

none                         5.0M     0  5.0M   0% /run/lock

none                         1.9G     0  1.9G   0% /run/shm

none                         100M     0  100M   0% /run/user

/dev/sda1                    236M   37M  187M  17% /boot

/dev/sdb1                    2.0T  143G  1.8T   8% /mnt/data

2테라라니.... 아니... 2테라라니....


과감히 다시 파티션 생성


$ sudo parted /dev/sdb

(parted) mklabel gpt    //label 타입을 만든다. (디스크 이름 아님)

Warning: The existing......

Yes/No? yes

(parted) unit TB          //사용할 단위설정

(parted) mkpart primary 0.00TB 3.00TB  //파티션 생성 primary, logical, extended

(parted) print           //확인

Model: ATA WDC WD30EFRX-68E (scsi)

Disk /dev/sdb: 3001GB

Sector size (logical/physical): 512B/4096B

Partition Table: gpt


Number  Start   End     Size    File system  Name     Flags

 1      1049kB  3001GB  3001GB  ext4         primary

(parted) quit


(한참뒤에 다시 작성하는 내용이라 처음 할때와 값이 조금씩 다릅니다.)

$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes

255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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

Disk identifier: 0x0001734c


   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048      499711      248832   83  Linux

/dev/sda2          501758   976771071   488134657    5  Extended

/dev/sda5          501760   976771071   488134656   8e  Linux LVM


WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.



Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes

255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x00000000


   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1  4294967295  2147483647+  ee  GPT

Partition 1 does not start on physical sector boundary.

...

sdb1이 잡혀있는 것을 확인했으니 ext4로 포멧합니다.


$ sudo mkfs.ext4 /dev/sdb1


포멧을 완료했으니 마운트를 시켜야 합니다.


마운트 폴더 생성 및 마운트

$ sudo mkdir /mnt/storage

$ sudo mount -t ext4 /dev/sdb1 /mnt/storage

폴더 경로나 이름은 자유롭게 변경하셔도 됩니다.


내용 확인
$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
none                         4.0K     0  4.0K   0% /sys/fs/cgroup
udev                         1.9G  4.0K  1.9G   1% /dev
tmpfs                        383M  500K  383M   1% /run
none                         5.0M     0  5.0M   0% /run/lock
none                         1.9G     0  1.9G   0% /run/shm
none                         100M     0  100M   0% /run/user
/dev/sda1                    236M   66M  158M  30% /boot
/dev/sdb1                    2.7T  226G  2.4T   9% /mnt/storage

(이미 다 적용하고 사용하던 도중 작성하는 터라 많은 용량이 사용중이네요)

여기까지 설정해도 사용할 수 있습니다.
다만 재부팅 할 경우 다시 마운트를 잡아줘야 합니다.

부팅 시 자동 마운트 설정을 위한 준비

ls -l 이나 ll 을 통해 /dev/disk/by-uuid/ 를 봅니다.

$ ls -l /dev/disk/by-uuid/

total 0

lrwxrwxrwx 1 root root 10 Jan  3 08:56 3b2553bf-8d02-47ae-8cc8-2f1ae55bd83f -> ../../sda1

lrwxrwxrwx 1 root root 10 Jan  3 08:56 77704fbf-00ea-432a-bfb9-b010ba7c0a85 -> ../../dm-0

lrwxrwxrwx 1 root root 10 Jan  3 08:56 95b721bd-8433-4db7-a5ba-2e88a30a01c3 -> ../../dm-1

lrwxrwxrwx 1 root root 10 Jan  3 08:56 9d2ca20a-78d6-48e1-bf96-c2d77c7a2eb1 -> ../../sdb1


연결된 sdb1 보조 하드디스크 uuid 를 복사 (다 다르니 본문의 내용을 복사하면 낭패)
9d2ca20a-78d6-48e1-bf96-c2d77c7a2eb1 


원하는 값을 복사했으니 자동으로 마운트를 시키기 위해 정보를 입력합니다.


자동 마운트 설정

$ sudo vi /etc/fstab


----파일내용----

# /etc/fstab: static file system information.

#

# Use 'blkid' to print the universally unique identifier for a

# device; this may be used with UUID= as a more robust way to name devices

# that works even if disks are added and removed. See fstab(5).

#

# <file system> <mount point>   <type>  <options>       <dump>  <pass>

/dev/mapper/Maybee--vg-root /               ext4    errors=remount-ro 0       1

# /boot was on /dev/sda1 during installation

UUID=3b2553bf-8d02-47ae-8cc8-2f1ae55bd83f /boot           ext2    defaults        0       2

/dev/mapper/Maybee--vg-swap_1 none            swap    sw              0       0


#NAS 3TB HDD

UUID=9d2ca20a-78d6-48e1-bf96-c2d77c7a2eb1 /mnt/storage ext4    errors=remount-ro       0       0



위 처럼 UUID와 마운트 위치, 포멧 등을 입력 해 줍니다.


재부팅 후 마운트가 자동으로 잘 되는지 확인 합니다.





+ Recent posts