/dev/vdb
128GiB 디스크에 64GiB ext4 + 64GiB XFS 2개 파티션을 생성하는 흐름을 기반으로 합니다.fdisk
에서 g
로 생성하실 수 있습니다.fstab
에 UUID를 사용하시면 장치명 변경에도 안전합니다.번호 | 필드명 | 의미 | 대표 입력 예시 | 핵심 포인트 |
---|---|---|---|---|
1 | spec | 무엇을 마운트? (소스) | UUID=... , PARTUUID=... , /dev/nvme0n1p2 , /dev/mapper/vg/lv , server:/exp (NFS), //srv/share (CIFS), tmpfs | UUID 권장 (blkid , lsblk -f 로 확인) |
2 | file | 어디에 마운트? (대상 경로) | / , /home , /data , /boot/efi , none (swap) | 디렉터리 미리 생성필요 |
3 | vfstype | 파일시스템 유형 | ext4 , xfs , vfat , btrfs , swap , nfs , cifs , tmpfs , iso9660 , ntfs-3g | bind 마운트는 보통 none 사용 + 옵션에 bind |
4 | options | 마운트 옵션(쉼표로 나열) | defaults , nofail , _netdev , ro/rw , noexec , nosuid , nodev , noatime/relatime , discard , x-systemd.automount , uid=,gid= (CIFS/FAT) | 용도/FS별 최적화(아래 템플릿 참고) |
5 | dump | dump 백업 사용 여부 | 0 (대부분), 1 (백업 대상) | 거의 항상 0 |
6 | pass | 부팅 시 fsck 순서 | 1 (루트), 2 (그 외), 0 (검사 안 함) | XFS/네트워크/ISO 등은 0 권장 |
# fdisk -l
출력 예시:
Disk /dev/vda: 256 GiB, 274877906944 bytes, 536870912 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: 0x27fda27d Device Boot Start End Sectors Size Id Type /dev/vda1 2048 8390655 8388608 4G 82 Linux swap / Solaris /dev/vda2 * 8390656 536870911 528480256 252G 83 Linux Disk /dev/vdb: 128 GiB, 137438953472 bytes, 268435456 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
# fdisk /dev/vdb
설정 예시:
Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): <ENTER> Using default response p. Partition number (1-4, default 1): <ENTER> First sector (2048-268435455, default 2048): <ENTER> Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-268435455, default 268435455): +64G Created a new partition 1 of type 'Linux' and of size 64 GiB.
Command (m for help): p
출력 예시:
Disk /dev/vdb: 128 GiB, 137438953472 bytes, 268435456 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: 0xdfd86f8e Device Boot Start End Sectors Size Id Type /dev/vdb1 2048 134219775 134217728 64G 83 Linux
Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): <ENTER> Using default response p. Partition number (2-4, default 2): <ENTER> First sector (134219776-268435455, default 134219776): <ENTER> Last sector, +/-sectors or +/-size{K,M,G,T,P} (134219776-268435455, default 268435455): <ENTER> Created a new partition 2 of type 'Linux' and of size 64 GiB.
Command (m for help): p
출력 예시:
Disk /dev/vdb: 128 GiB, 137438953472 bytes, 268435456 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: 0xdfd86f8e Device Boot Start End Sectors Size Id Type /dev/vdb1 2048 134219775 134217728 64G 83 Linux /dev/vdb2 134219776 268435455 134215680 64G 83 Linux
Command (m for help): wq
# fdisk -l /dev/vdb
출력 예시:
Disk /dev/vdb: 128 GiB, 137438953472 bytes, 268435456 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: 0xdfd86f8e Device Boot Start End Sectors Size Id Type /dev/vdb1 2048 134219775 134217728 64G 83 Linux /dev/vdb2 134219776 268435455 134215680 64G 83 Linux
# mkfs.ext4 /dev/vdb1
출력 예시:
mke2fs 1.46.5 (30-Dec-2021) Discarding device blocks: done Creating filesystem with 16777216 4k blocks and 4194304 inodes Filesystem UUID: 55212d85-8e23-49e0-a494-c8e4f6954dfc Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424 Allocating group tables: done Writing inode tables: done Creating journal (131072 blocks): done Writing superblocks and filesystem accounting information: done
# mkfs.xfs /dev/vdb2
출력 예시:
meta-data=/dev/vdb2 isize=512 agcount=4, agsize=4194240 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 bigtime=1 inobtcount=1 nrext64=0 data = bsize=4096 blocks=16776960, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=16384, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 Discarding blocks...Done.
# mkdir /mnt/{ext4,xfs} # mount /dev/vdb1 /mnt/ext4/ # mount /dev/vdb2 /mnt/xfs/
# df -Th
출력 예시:
Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 4.0M 0 4.0M 0% /dev tmpfs tmpfs 16G 0 16G 0% /dev/shm tmpfs tmpfs 6.3G 8.7M 6.3G 1% /run /dev/vda2 xfs 252G 15G 238G 6% / tmpfs tmpfs 3.2G 4.0K 3.2G 1% /run/user/0 /dev/vdb1 ext4 63G 24K 60G 1% /mnt/ext4 /dev/vdb2 xfs 64G 489M 64G 1% /mnt/xfs
# blkid /dev/vdb1
출력 예시:
/dev/vdb1: UUID="55212d85-8e23-49e0-a494-c8e4f6954dfc" TYPE="ext4" PARTUUID="dfd86f8e-01"
# vi /etc/fstab
설정 예시:
+ UUID=55212d85-8e23-49e0-a494-c8e4f6954dfc /mnt/ext4 ext4 defaults 0 0 + /dev/vdb2 /mnt/xfs xfs defaults 0 0
# reboot
# df -Th
출력 예시:
Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 4.0M 0 4.0M 0% /dev tmpfs tmpfs 16G 0 16G 0% /dev/shm tmpfs tmpfs 6.3G 8.7M 6.3G 1% /run /dev/vda2 xfs 252G 15G 238G 6% / tmpfs tmpfs 3.2G 4.0K 3.2G 1% /run/user/0 /dev/vdb1 ext4 63G 24K 60G 1% /mnt/ext4 /dev/vdb2 xfs 64G 489M 64G 1% /mnt/xfs
# vi /etc/fstab
설정 예시:
- UUID=55212d85-8e23-49e0-a494-c8e4f6954dfc /mnt/ext4 ext4 defaults 0 0 - /dev/vdb2 /mnt/xfs xfs defaults 0 0
# cat /etc/fstab
출력 예시:
UUID=2843d0a7-070f-4d68-b456-7096e8d328a6 / xfs defaults 0 0 UUID=9ac41100-cedc-4a7d-aac0-0dc89de9deb2 none swap defaults 0 0
# umount /mnt/ext4 /mnt/xfs # df -Th
출력 예시:
Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 4.0M 0 4.0M 0% /dev tmpfs tmpfs 16G 0 16G 0% /dev/shm tmpfs tmpfs 6.3G 8.7M 6.3G 1% /run /dev/vda2 xfs 252G 15G 238G 6% / tmpfs tmpfs 3.2G 4.0K 3.2G 1% /run/user/0
# fdisk /dev/vdb
설정 예시:
Command (m for help): p Disk /dev/vdb: 128 GiB, 137438953472 bytes, 268435456 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: 0xdfd86f8e Device Boot Start End Sectors Size Id Type /dev/vdb1 2048 134219775 134217728 64G 83 Linux /dev/vdb2 134219776 268435455 134215680 64G 83 Linux Command (m for help): d Partition number (1,2, default 2): 1 Partition 1 has been deleted.
Command (m for help): p
출력 예시:
Disk /dev/vdb: 128 GiB, 137438953472 bytes, 268435456 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: 0xdfd86f8e Device Boot Start End Sectors Size Id Type /dev/vdb2 134219776 268435455 134215680 64G 83 Linux
Command (m for help): d Selected partition 2 Partition 2 has been deleted.
Command (m for help): p
출력 예시:
Disk /dev/vdb: 128 GiB, 137438953472 bytes, 268435456 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: 0xdfd86f8e
Command (m for help): wq
# fdisk -l /dev/vdb
출력 예시:
Disk /dev/vdb: 128 GiB, 137438953472 bytes, 268435456 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: 0xdfd86f8e
Command (m for help): m
출력 예시:
Help: DOS (MBR) a toggle a bootable flag b edit nested BSD disklabel c toggle the dos compatibility flag Generic d delete a partition F list free unpartitioned space l list known partition types n add a new partition p print the partition table t change a partition type v verify the partition table i print information about a partition Misc m print this menu u change display/entry units x extra functionality (experts only) Script I load disk layout from sfdisk script file O dump disk layout to sfdisk script file Save & Exit w write table to disk and exit q quit without saving changes Create a new label g create a new empty GPT partition table G create a new empty SGI (IRIX) partition table o create a new empty DOS partition table s create a new empty Sun partition table
Command (m for help): F
출력 예시:
Unpartitioned space /dev/vdb: 128 GiB, 137437904896 bytes, 268433408 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes Start End Sectors Size 2048 268435455 268433408 128G
1. 개요 Linux에서 디스크 파티션 스타일은 MBR(Master Boot Record) 와 GPT(GUID Partition Table)에 대해 설명합니다. 2. MBR이란? 디스크…
https://youtu.be/CNd1bJV4wGY 1. 개요 Windows Server를 새로 설치할 때의 설치 과정을 단계별로 정리하였습니다. Windows Server 설치…
https://youtu.be/dVe6vc76yL0 1. 개요 Rocky Linux 9.5 환경에서 두 개의 NIC를 하나로 묶는 Active-Backup Bonding 구성 후, 해당…
https://youtu.be/48ebJfKsCuw 1. 개요 KVM 가상화 환경에서 Isolated 네트워크를 생성하고 VM에 할당하는 방법을 설명합니다. Isolated 네트워크는…
https://youtu.be/5B-0lWtc6N4 1. 개요 KVM 환경에서 NAT 네트워크를 생성하고 VM에 할당하는 방법을 설명합니다. CLI(virsh)와 GUI(virt-manager) 모두를…
https://youtu.be/2UUUOtFfPUk 1. 개요 virt-install 명령어를 이용해 KVM/QEMU 환경에서 Windows 11 24H2 버전을 설치하는 방법을 소개합니다. GUI 없이 CLI…