리눅스에서 파일 시스템 마운트하기 안녕하세요, mj입니다. 오늘은 리눅스에서 파일 시스템을 마운트하는 방법에 대해 알아보겠습니다. 파일 시스템을 마운트하는 것은 리눅스 운영체제에서 필수적인 작업 중 하나입니다. 이를 통해 외부 저장 장치나 다른 파일 시스템에 접근할 수 있게 됩니다. 그럼 시작해볼까요? 1. 파일 시스템 마운트란? 파일 시스템 마운트는 특정 디렉토리에 다른 파일 시스템을 연결하는 과정을 의미합니다. 이 과정을 통해 사용자는 해당 파일 시스템의 파일을 접근하고 사용할 수 있게 됩니다. 2. 마운트하기 전 준비사항 마운트를 하기 위해서는 우선 사용할 장치와 마운트 포인트를 준비해야 합니다. 마운트 포인트는 파일 시스템이 연결될 디렉토리입니다. 예를 들어, /mnt/mydrive와 같은 위치를 사용할 수 있습니다. 3. 파일 시스템 마운트하기 파일 시스템을 마운트하는 기본적인 명령어는 mount 입니다. 다음은 그 사용 예시입니다: sudo mount /dev/sdb1 /mnt/mydrive 위 명령어는 /dev/sdb1 장치를 /mnt/mydrive 디렉토리에 마운트합니다. 만약 해당 디렉토리가 존재하지 않는다면, 먼저 생성해야 합니다: sudo mkdir /mnt/mydrive 3.1. 마운트 결과 확인하기 마운트가 성공적으로 이루어졌는지 확인하려면 df -h 명령어를 사용할 수 있습니다. 해당 명령어는 현재 마운트된 파일 시스템의 정보를 보여줍니다. df -h 4. 예시: 다양한 마운트 옵션 마운트 시 다양한 옵션을 사용할 수 있습니다. 다음은 몇 가지 예시입니다: 4.1. 읽기 전용으로 마운트하기 sudo mount -o ro /dev/sdb1 /mnt/mydrive 4.2. 특정 파일 시스템 형식으로 마운트하기 sudo mount -t ntfs /dev/sdb1 /mnt/mydrive 4...
안녕하세요, MJ 입니다.
df 명령어에 대해 작성 해 봅니다.
: 마운트 된 파일 시스템의 사용량을 확인하는 명령어입니다.
df 명령어 결과를 확인 해 보겠습니다.
* df 명령어 수행결과
[df 명령어 수행결과] |
: 명령어 수행 결과에서 여러가지 정보가 확인됩니다.
필드명 | 설명 |
---|---|
Filesystem | 마운트 장치 |
1K-blocks | 파티션의 크기 |
Used | 사용된 용량 |
Available | 사용할 수 있는 용량 |
Use% | 사용된 용량의 백분율 |
Mounted on | 마운트 된 디렉토리 |
옵션 없이 df 명령어 수행 결과에서 확인되는 필드의 설명 입니다.
외에도 -T 옵션을 추가하면 파일시스템 타입이 기록되는 Type 필드가 추가로 확인됩니다.
도움말 입니다.
<[root@run-linux ~]# df --help Usage: df [OPTION]... [FILE]... Show information about the file system on which each FILE resides, or all file systems by default. Mandatory arguments to long options are mandatory for short options too. -a, --all include pseudo, duplicate, inaccessible file systems : 중복 또는 액세스 할 수 없는 파일시스템을 포함하여 모두 확인 합니다. -B, --block-size=SIZE scale sizes by SIZE before printing them; e.g., '-BM' prints sizes in units of 1,048,576 bytes; see SIZE format below : -BM (메가바이트), -BG (기가바이트), -BK (키로바이트), -B1000 (1000바이트단위) 출력되는 용량의 단위를 지정합니다. --direct show statistics for a file instead of mount point -h, --human-readable print sizes in powers of 1024 (e.g., 1023M) : 사람이 읽기 좋은 형태로 출력됩니다. -H, --si print sizes in powers of 1000 (e.g., 1.1G) : 고정 단위가 아니라 크기에 맞게 단위를 표시하고 읽기 좋은 형태로 출력됩니다. -i, --inodes list inode information instead of block usage : 아이노드 사용량이 표시됩니다. -k like --block-size=1K : 키로바이트 단위로 사용량이 표시됩니다. -l, --local limit listing to local file systems : 로컬 장치만 출력합니다. --no-sync do not invoke sync before getting usage info (default) --output[=FIELD_LIST] use the output format defined by FIELD_LIST, or print all fields if FIELD_LIST is omitted. -P, --portability use the POSIX output format : 한 줄로 출력됩니다. --sync invoke sync before getting usage info --total elide all entries insignificant to available space, and produce a grand total -t, --type=TYPE limit listing to file systems of type TYPE : 지정한 파일시스템만 출력. -T, --print-type print file system type : 파일시스템 이름을 함께 출력. -x, --exclude-type=TYPE limit listing to file systems not of type TYPE : 출력에서 제외 할 파일시스템을 지정. -v (ignored) --help display this help and exit --version output version information and exit Display values are in units of the first available SIZE from --block-size, and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables. Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set). The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and so on. FIELD_LIST is a comma-separated list of columns to be included. Valid field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent', 'size', 'used', 'avail', 'pcent', 'file' and 'target' (see info page). GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Full documentation <https://www.gnu.org/software/coreutils/df> or available locally via: info '(coreutils) df invocation' |
df 명령어에 대해 간략하게 알아보았습니다.
문의사항은 댓글을 달아 주시면 성심껏 답변 드리겠습니다.
감사합니다.
댓글
댓글 쓰기