[quote="mimiqq11":kmli76ad][quote="yemharc":kmli76ad]
스왑파일은 파티션과 다르게 자동 마운트가 되지 않고, 따로 설정파일도 존재하지 않습니다.
다만, 스왑 파티션과 마찬가지로 /etc/fstab에 등록하면 자동으로 마운트 됩니다.
ex) swf 란 이름을 가진 스왑파일이 /home/swap 에 존재한다면 /etc/fstab 파일에 아래처럼 등록한다.
/home/swap/swf none swap sw 0 0[/quote:kmli76ad]
언제나 초보사용자입니다.
답변 고맙습니다.
그렇다면 내가 여러개의 swap file을 만들어 두었는데, 각각의 file name을 모르고 있다면
사용할 수 없다는 뜻인가요?
물론 위에서 말씀하신대로 처음부터 /etc/fstab에 등록해 두면 알겠지만,
수동으로 마운트 시킨다고 한다면 결국 내가 각각의 file name을 알아야 한다는 뜻인것이 맞겠지요?
고수님들의 무한답변 부탁드립니다.[/quote:kmli76ad]
스왑파일을 찾는데에 따로 특정 방법이 있진 않고, 명령어 조합을 이용해서 찾을수는 있습니다.
일단 file 이라는 명령어가 있는데, 이건 해당 파일의 타입을 알려주는 명령어입니다.
[code:kmli76ad]
yemharc@ubuntu:~$ file test.c
test.c: ASCII text
yemharc@ubuntu:~$
yemharc@ubuntu:~$ file test
test: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xfc25294d8a6bf059dd3359a366db9262d1e983b7, not stripped
yemharc@ubuntu:~$
yemharc@ubuntu:~$ file swf
swf: Linux/i386 swap file (new style), version 1 (4K pages), size 65535 pages, no label, UUID=f9b013bf-ca52-42e6-bf8f-0ad49f3c9adf
yemharc@ubuntu:~$
[/code:kmli76ad]
이런 식으로 file 명령을 이용하면 해당 파일의 타입을 포함은 각종 정보를 얻을 수 있습니다.
그리고 예문의 제일 아래를 보면 swap file 또한 file 명령을 이용해 구분할 수 있는걸 확인 가능합니다.
그럼 이걸 응용하면 아래처럼 각종 파일/폴더가 있는 상태에서 find와 조합하여 추려내는게 가능해집니다.
[code:kmli76ad]
EX)
yemharc@ubuntu:~$ pwd
/home/yemharc
yemharc@ubuntu:~$ ls -al
total 262196
drwxr-xr-x 3 yemharc yemharc 4096 May 31 21:10 .
drwxr-xr-x 3 root root 4096 May 31 20:54 ..
-rw-r–r-- 1 yemharc yemharc 220 May 31 20:54 .bash_logout
-rw-r–r-- 1 yemharc yemharc 3486 May 31 20:54 .bashrc
drwx------ 2 yemharc yemharc 4096 May 31 20:54 .cache
-rw------- 1 yemharc yemharc 41 May 31 20:56 .lesshst
-rw-r–r-- 1 yemharc yemharc 675 May 31 20:54 .profile
-rw-r–r-- 1 root root 268435456 May 31 20:55 swf
-rwxrwxr-x 1 yemharc yemharc 8326 May 31 21:10 test
-rw-rw-r-- 1 yemharc yemharc 44 May 31 21:10 test.c
-rw------- 1 yemharc yemharc 657 May 31 21:10 .viminfo
yemharc@ubuntu:~$
yemharc@ubuntu:~$ find . * -exec file {} ; |grep ‘swap file’
./swf: Linux/i386 swap file (new style), version 1 (4K pages), size 65535 pages, no label, UUID=f9b013bf-ca52-42e6-bf8f-0ad49f3c9adf
./.cache/swf2: Linux/i386 swap file (new style), version 1 (4K pages), size 65535 pages, no label, UUID=f9b013bf-ca52-42e6-bf8f-0ad49f3c9adf
swf: Linux/i386 swap file (new style), version 1 (4K pages), size 65535 pages, no label, UUID=f9b013bf-ca52-42e6-bf8f-0ad49f3c9adf
yemharc@ubuntu:~$
[/code:kmli76ad]
검색결과 현재 폴더의 swf 파일(./swf)과 .cache 폴더 아래의 swf2 파일(./.cache/swf2)이 swap file이라고 나오네요.
이 외엔 딱히 다른 방법이 있는지 모르겠군요.