728x90
1. disk 확인
[root@test ~]# fdisk -l Disk /dev/sdb: 3.7 TiB, 4000225165312 bytes, 7812939776 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 |
2. parted 명령어로 GPT 파티션 생성
[root@test ~]# parted /dev/sdb
(parted) print //disk 상태 확인 Error: /dev/sdb: unrecognised disk label Disk /dev/sdb: 4000GB Sector size (logical/physical): 512B/512B Partition Table: unknown //partition 상태 확인 Disk Flags: (parted) mklabel gpt //gpt 생성 (parted) print Disk /dev/sdb: 4000GB Sector size (logical/physical): 512B/512B Partition Table: gpt //생성 확인 Disk Flags: Number Start End Size File system Name Flags (parted) mkpart primary 0 4000GB //disk 용량 할당 Warning: The resulting partition is not properly aligned for best performance: 34s % 2048s != 0s Ignore/Cancel? I //경고 무시 (I) 입력 (parted) print //생성 확인 Disk /dev/sdb: 4000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 17.4kB 4000GB 4000GB primary |
728x90
3. ext4 파일시스템 생성
[root@test ~]# mkfs.ext4 /dev/sdb1
mke2fs 1.45.6 (20-Mar-2020) Creating filesystem with 976617463 4k blocks and 244154368 inodes Filesystem UUID: 5690f284-0753-47b7-9867-f8842e6e61ee Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2 654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 786759 68, 102400000, 214990848, 512000000, 550731776, 644972544 Allocating group tables: done Writing inode tables: done Creating journal (262144 blocks): done Writing superblocks and filesystem accounting information: done |
4. mount 하기
[root@test ~]# mkdir /data
[root@test ~]# mount /dev/sdb1 /data
[root@test ~]# df -h
Filesystem Size Used Avail Use% Mounted on devtmpfs 16G 0 16G 0% /dev tmpfs 16G 0 16G 0% /dev/shm tmpfs 16G 11M 16G 1% /run tmpfs 16G 0 16G 0% /sys/fs/cgroup /dev/mapper/rl-root 493G 8.4G 485G 2% / /dev/sda2 1014M 267M 748M 27% /boot /dev/sda1 599M 5.8M 594M 1% /boot/efi tmpfs 3.2G 36K 3.2G 1% /run/user/1000 /dev/sdb1 3.6T 28K 3.4T 1% /data |
5. fstab 추가
[root@test ~]# vi /etc/fstab
# /etc/fstab # Created by anaconda on Mon Apr 15 07:10:16 2024 # # Accessible filesystems, by reference, are maintained under '/dev/disk/'. # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. # # After editing this file, run 'systemctl daemon-reload' to update systemd # units generated from this file. # /dev/mapper/rl-root / xfs defaults 0 0 UUID=6dc6a85d-b74c-4ca4-957f-aceb60b50cf8 /boot xfs defaults 0 0 UUID=2CFB-2AF7 /boot/efi vfat umask=0077,shortname=winnt 0 2 /dev/mapper/rl-swap none swap defaults 0 0 /dev/sdb1 /data ext4 defaults 0 0 |
728x90
'IT > LINUX' 카테고리의 다른 글
[ ANSIBLE ] awx install (0) | 2024.06.05 |
---|---|
rocky8 ntp 서버 만들기 (0) | 2024.05.16 |
rocky8 윈도우 공유 폴더 만들기(samba, cifs) (0) | 2024.04.02 |
linux magaraid gui 설치 방법 (0) | 2023.11.09 |
rocky8 Glusterfs 구성 (0) | 2023.11.07 |