Filesystem , swap, device

Preview:

DESCRIPTION

ravel@sparcs. Filesystem , swap, device. 1. Filesystem. In computing , a file system (often also written as filesystem ) is a method for storing and organizing computer files and the data they contain to make it easy to find and access them. ( wikipedia ) Permits random access 추상화. - PowerPoint PPT Presentation

Citation preview

FILESYSTEM, SWAP, DE-VICE

ravel@sparcs

1. Filesystem

In computing, a file system (often also written as filesystem) is a method for storing and organizing computer files and the data they contain to make it easy to find and access them. (wikipedia)

Permits random access

추상화

종류

ext2/ext3

VFAT / NTFS

Iso9660/UDF

/proc

/proc/filesystems 에서 확인

mount!

#mount –t : 파일시스템 가져다 붙이기

mount!

#mount –t type device mount-point

#mount –t msdos /dev/fd0 /mnt

#mount –t iso9660 –r /dev/cdrom /mnt (read only)

mount!

#mount –a/etc/fstab 에 있는 모든 장치들을 마운트

#umount /dev/fd0#umount /mnt

#umount –f

mount! #mount

Mount errors

/etc/fstab #mount –t <type> <file system> <mount point>

이 명령이 부팅할 때 이루어짐

/etc/fstab Q : /etc/fstab 에는 어떻게 접근하나 ?

A: 커널이 먼저 / 에 /etc/fstab 를 담고있는 디바이스를 마운트

파일시스템 만들기

#mkfs –t type device

#fdformat

파일시스템 만들기

#mkfs -cchecks for bad blocks

파일시스템 검사하기

#fsck –t type device

#fsck –t ext3 /dev/hda안됩니다

파일시스템 검사하기

Boot/root floppy

Mount root as ro (?)

파일시스템 검사하기

#fsck –v정보 출력

#fsck –a모든 파일시스템 점검

2. Swap

Swap file: RAM 에 빈공간이 없을 때 메모리 구실을 하는 특수한 파일

Swap out/in : 메모리에서 하드로 / 하드에서 메모리로

스왑

$free

단위는 1024-byte block

A) 스왑파일 B) 스왑파티션 -> fdisk

스왑 만들기

$dd if=/dev/zero of=/swap bs=1024 count=32768

#mkswap device size#mkswap –c device (size)

#chmod 0600 /swap

스왑 만들기

#swapon device

Modify /etc/fstab

#swapoff device

스왑 활성화

Device file : 디바이스를 하나의 파일처럼 만들기 ( 추상화 !)

3.Device files

b/c major device number, minor device

number

Symbolic links

디바이스 파일 만들기

#mknod –m permissions name type major minor

#mknod /dev/ravelhdd b 42 0

$/dev/MAKEDEV

default permissions : umask (0644)