메뉴 닫기

xfs 파일 시스템 error

root@localhost:~# tail -f /var/log/messages
Mar 22 10:46:17 localhost kernel: [414317.360193] XFS (sda1): xfs_log_force: error -5 returned.

의 메시지와 관련하여 여러 이유를 들 수 있겠으나 본 글에서는 file system 과 관련하여 서술.
글쓴이가 file system error로 방향을 잡은 배경은 다음과 같다.
해당 error 가 출력된 시스템은 raid6로 구성되어져 있으며. 구성 후 raid tool로 확인 중 initializing 과정이
비정상적으로 느리게 진행됨을 확인.
(해당 서버는 테스트 서버로 HDD는 모두 기존에 어떠한 다른 용도로 사용된 적이 있으며, 단순 초기화만 진행. – bad : no check- )

일단 raid tool에 출력되는 disk 상의 문제는 없는 것으로 보아 파일시스템으로 접근한 것.

xfs의 파일 시스템 체크 사용법과 옵션은 아래와 같음.
(다른 파일시스템의 체크나 복구와 마찬가지로 xfs 체크시에도 해당 디바이스가 마운트되어 있다면 umount 해줄 것.)

root@localhost:~# xfs_repair -help
xfs_repair: invalid option — ‘h’
Usage: xfs_repair [options] device

Options:
  -f The device is a file
  -L Force log zeroing. Do this as a last resort.
  -l logdev Specifies the device where the external log resides.
  -m maxmem Maximum amount of memory to be used in megabytes.
  -n No modify mode, just checks the filesystem for damage.
  -P Disables prefetching.
  -r rtdev Specifies the device where the realtime section resides.
  -v Verbose output.
  -c subopts Change filesystem parameters – use xfs_admin.
  -o subopts Override default behaviour, refer to man page.
  -t interval Reporting interval in minutes.
  -d Repair dangerously.
  -V Reports version and exits.
root@localhost:~# 

일반적 사용 옵션으로 -f를 해주었다. 여전히 같은 반응.
root@localhost:~# xfs_repair -f /dev/sda

-> -L 옵션은 더 강력한 진행 옵션으로 데이터의 유실이 있을 수 있는 옵션이기에 신중할 것.
   글쓴이는 데이터는 없는 관계로 별도의 백업 없이 진행함.

root@localhost:~# xfs_repair -f -L -v /dev/sda

root@localhost:~# xfs_repair /dev/sda (무옵션일 경우 xfs 로그 복구 있다.)

xfs 확인
root@localhost:~# xfs_check /dev/sda 2>&1 | tee log.log – 

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 항목은 *(으)로 표시합니다