리눅스의 tmpfs 파일 시스템 (기본 개념)

개인 블로그 홈 페이지 (자세한 내용은 클릭) - https://blog.51cto.com/11495268
개인 마이크로 채널 공용 수 (자세한 내용을 보시려면 클릭) - https://blog.51cto.com/11495268/2401194

    

1. 소개
    이 문서에서는 파일 시스템의 tmpfs 기본 개념을 설명; ceph bluestore의 tmpfs 파일 시스템은 지금의 tmpfs 파일 시스템에서 학습 장착
 

2, tmpfs를 기본
2.1의 tmpfs는 소개
    의 tmpfs를 (임시 파일 시스템) 리눅스 특정 파일 시스템입니다

  • 표준 마운트 포인트는 / dev / SHM (또한 사용자 정의 할 수 있음)
  • 기본 크기는 실제 메모리의 절반
  • tmpfs를이만큼 실장으로 즉시 사용할 수있는 별도의 파일 시스템이 아니라 블록 장치 인
         

# free -h
              total        used        free      shared  buff/cache   available
Mem:            31G        8.5G         22G         33M        654M         22G
Swap:           15G        4.0M         15G

# df -h 
Filesystem                   Size  Used Avail Use% Mounted on
tmpfs                         16G   24K   16G   1% /var/lib/ceph/osd/ceph-4
tmpfs                         16G   24K   16G   1% /var/lib/ceph/osd/ceph-2
tmpfs                         16G   24K   16G   1% /var/lib/ceph/osd/ceph-0
... ...

    

2.2 tmpfs를 특징
    일시 : tmpfs의 메모리에 내장되어 있기 때문에, 정전에의 tmpfs에 저장된 모든 데이터가 언로드 이후 손실됩니다
    빠른 읽기와 쓰기 능력 : 메모리 액세스 속도가 디스크보다 훨씬 빠른 I / O 작업하는 경우에도 성능은 여전히 타의 추종을 불허 스왑을 사용하여
    더 많은 메모리를 할당 할 파일 시스템을 tmpfs는, 동적의 필요에 따라 파일 시스템 공간을 증가의 tmpfs는하지만, 사본, 매우 작은 공간에서 시작하고 파일을 만들; 동적 수축 의 tmpfs 파일이 삭제 된 경우와,의 tmpfs 파일 시스템은 동적으로 파일 및 최대 사용 가능한 메모리 자원을 줄일 수
    

3, tmpfs를 마운트
3.1 설치
3.1.1 직접 마운트

# mount -t tmpfs -o size={size} tmpfs {mount_point}

    

3.1.2 다시 마운트

# mount -t tmpfs -o remount tmpfs {mount_point}

    

카이에서 3.2 부팅

# cat /etc/fstab
# /etc/fstab: static file system information.
    
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
#  /was on /dev/sda3 during installation
tmpfs                   /tmp    tmpfs   defaults,size=25M        0 0

추천

출처blog.51cto.com/11495268/2424414