보통 리눅스 배포 FTP사이트에 가면 ISO 이미지라는 것이 한방을 차지하고 있는 경우가 대부분이다.
ISO 이미지는 보통 CD에 기록(보통 구운다고 한다.)하기위한 파일이라고 생각하면 된다.
그러니까 ISO 이미지 파일을 다운로드하여 CD 레코더와 레코팅용 프로그램을 이용하여 하나의 CD로 만들어 낼 수 있는 것이다.
우선 개념은 그러하지만... 필자에게는 CD레코더가 없다.
CD레코더가 없으면 어떻게 ISO 이미지 파일의 내부에 존재하는 파일들을 사용할까?
오늘 올라온 RedHat 6.2(Zoot) ISO 이미지 파일을 몇분전에 모두 다운로드 하였다.
이제 다운로드된 하나의 이미지 파일(zoot-i386.iso)을 마치 CD를 넣어 마운트 하듯이 마운트하여 자유롭게 읽어내보도록 하겠다.
다시말해 보통의 CD를 마운트 하듯이 마운트하면 되는 것이며, 약간의 추가옵션만 기억하면 될것이므로 많은 설명이 필요치 않을 것이다.
* 형식 *
# mount -t iso9660 -o ro,loop=/dev/loop0 ISO파일 마운트포인트
그럼 오늘 받은 RedHat 6.2(Zoot)를 마운트하고 파일을 읽어볼까?
# mount -t iso9660 -o ro,loop=/dev/loop0 /home/way/zoot-i386.iso /mnt/cdrom
# df /mnt/cdrom/
Filesystem 1k-blocks Used Available Use% Mounted on
/home/way/zoot-i386.iso 656134 656134 0 100% /mnt/cdrom
df 명령으로 마운트가 잘 되었음을 확인할 수 있다.
만약 자주 해당 ISO 이미지를 마운트하여 사용할 것이라면 /etc/fstab 파일에 다음과 같은 부분을 넣어두고 간단히 # mount /mnt/cdrom 이라고만 명령을 줘도 되겠다.
/home/way/zoot-i386.iso /mnt/cdrom iso9660 noauto,ro,loop=/dev/loop0 0 0
당연한 이야기지만 마운트 해제는 # umount /mnt/cdrom 하면 된다.
이제 파일목록을 조회해보자.
# ls -al /mnt/cdrom/
total 73
drwxrwxr-x 8 root root 2048 Mar 9 08:02 ./
drwxr-xr-x 5 root root 1024 Mar 4 04:54 ../
-rw-rw-r-- 1 root root 2588 Mar 9 07:51 .buildlog
-rw-r--r-- 8 root root 18385 Sep 8 1999 COPYING
-rw-r--r-- 9 root root 3400 Mar 9 00:42 README
-rw-r--r-- 18 root root 16300 Mar 9 04:10 RELEASE-NOTES
-rw-r--r-- 8 root root 1908 Sep 26 1999 RPM-GPG-KEY
drwxrwxr-x 5 root root 2048 Mar 9 07:51 RedHat/
-r--r--r-- 1 root root 544 Mar 10 03:37 TRANS.TBL
-rwxr-xr-x 9 root root 538 Sep 26 1999 autorun*
-rwxr--r-- 1 root root 2048 Mar 9 08:02 boot.cat*
drwxrwxr-x 5 root root 2048 Mar 10 02:40 doc/
drwxrwxr-x 6 root root 4096 Mar 9 07:51 dosutils/
drwxrwxr-x 7 root root 2048 Mar 9 07:51 images/
drwxrwxr-x 4 root root 2048 Mar 9 07:51 misc/
dr-xr-xr-x 51 root root 8192 Jan 1 1970 rr_moved/
내친김에 파일도 하나 열어보자. :)
# cat /mnt/cdrom/README
Red Hat Linux/Intel 6.2 (Zoot)
==============================
The contents of this CD-ROM are Copyright (C) 2000 Red Hat, Inc. and others.
Please see the individual copyright notices in each source package for
distribution terms. The distribution terms of the tools copyrighted by
Red Hat, Inc. are as noted in the file COPYING.
Red Hat and RPM are trademarks of Red Hat, Inc.
============================================================================
DIRECTORY ORGANIZATION
This directory is organized as follows:
/mnt/redhat
|----> RedHat
|----> RPMS -- binary packages
|----> base -- small filesystem setup archives
|----> instimage -- image used for installs
|----> images -- boot and ramdisk images
|----> dosutils -- installation utilities for DOS
|----> doc -- various FAQs and HOWTOs
|----> misc -- source code for installation process
|----> COPYING -- copyright information
|----> README -- this file
|----> RPM-GPG-KEY -- GPG signature for packages from Red Hat
If you are mirroring to a partition or an NFS volume, you'll need to
get everything under RedHat, as well as the disk images from images
that you need for your system.
============================================================================
< 하단 생략 >