삽질/개발,엔지니어링

NAS에 하드디스크 추가

maengis 2023. 5. 18. 18:26

딱히 필요는 없는데 NAS에 디스크 베이가 하나 남은 게 계속 생각이 나서 그냥 샀다.

세상 좋아졌다. 해외 구매인데 일 주일도 안 돼서 왔음.

 

디스크 끼우고 파티션 생성

# fdisk /dev/sdf

Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
The size of this disk is 7.3 TiB (8001563222016 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).

Created a new DOS disklabel with disk identifier 0xadf9205c.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-4294967295, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-4294967295, default 4294967295):

Created a new partition 1 of type 'Linux' and of size 2 TiB.

Command (m for help): p
Disk /dev/sdf: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2U91
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xadf9205c

Device     Boot Start        End    Sectors Size Id Type
/dev/sdf1        2048 4294967295 4294965248   2T 83 Linux

Command (m for help): w

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

 

포맷

mkfs -t ext4 /dev/sdf

 

마운트

mkdir /mnt/storage_4th/
chmod 777 /mnt/storage_4th/
mount /dev/sdf /mnt/storage_4th/

 

SMB 설정에 추가 하고 재시작

vi /etc/samba/smb.conf
/etc/init.d/smbd restart
반응형