/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
https://youtu.be/n8-wlkZiqio 1. 개요 NFS(Network File System)를 설치하고, rw/ro 및 root_squash 옵션에 따른 접근 제어와 성능을 테스트하는 방법을 정리한 가이드입니다.…
https://youtu.be/4MVxzmepY3s 1. 개요 리눅스에서 정기적으로 실행되는 작업(백업, 로그 정리, 모니터링 등)은 cron 서비스를 통해 자동화할 수 있습니다.…
https://youtu.be/vPfxWFBE1yc 1. 개요 리눅스 서버를 운영할 때 사용자 계정 생성, 비밀번호 설정, 권한 부여, 계정…
https://youtu.be/Gvp2XwBfoKw 1. 개요 리눅스 서버에서는 시스템 시간(OS 시간) 과 하드웨어 시간(RTC, Real-Time Clock) 을 동기화하는 것이 매우 중요합니다. 클러스터…
https://youtu.be/pt9qhawl8LY 1. 개요 리눅스 서버에서는 시스템 시간(OS 시간) 과 하드웨어 시간(RTC, Real-Time Clock) 을 모두 관리할 수 있습니다. 운영체제의…
https://youtu.be/iPdHGXh7DUg 1. 개요 서버 운영 시 시스템 시간이 올바르게 설정되어 있지 않으면 로그 분석, 모니터링,…