From Evernote: |
全Linux生活:第15天 - 製作光碟ISO |
在Linux下製作ISO真是出奇的簡單,用dd或mkisofs就搞定了。
從硬碟資料產生ISO,請服用:
$ mkisofs -o /tmp/cd.iso /source_directory
從光碟機產生ISO,請服用:
$ dd if=<device> of=/tmp/image.iso
其中<device>就是光碟機的裝置,我目前的Ubuntu是/dev/sr0,但有些可能是叫/dev/cdrom或/dev/hdc或/dev/sdb之類的,如果真的不確定,可以用指令查一下:
$ dmesg|grep CD-ROM
[ 3.693625] scsi 1:0:0:0: CD-ROM HL-DT-ST DVD+-RW GA31N A102 PQ: 0 ANSI: 5
[ 3.706587] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 3.706778] sr 1:0:0:0: Attached scsi CD-ROM sr0
[ 3.706587] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 3.706778] sr 1:0:0:0: Attached scsi CD-ROM sr0
如果什麼都沒有,哪你可能要懷疑一下你的電腦是不是有光碟機?不過還是可以來找看看,查一下系統目前有哪些磁碟裝置:
$ ls -l /sys/block/*/device
lrwxrwxrwx 1 root root 0 2011-05-15 11:02 /sys/block/sda/device -> ../../../0:0:0:0
lrwxrwxrwx 1 root root 0 2011-05-15 11:32 /sys/block/sdb/device -> ../../../5:0:0:0
lrwxrwxrwx 1 root root 0 2011-05-15 11:02 /sys/block/sr0/device -> ../../../1:0:0:0
lrwxrwxrwx 1 root root 0 2011-05-15 11:32 /sys/block/sdb/device -> ../../../5:0:0:0
lrwxrwxrwx 1 root root 0 2011-05-15 11:02 /sys/block/sr0/device -> ../../../1:0:0:0
然後看一下裝置type是不是5,因為5表示ROM,如果看到是0,表示是DISK:
$ cat /sys/block/sda/device/type
0
0
$ cat /sys/block/sdb/device/type
0
0
$ cat /sys/block/sr0/device/type
5
5
如果吃飽太閒沒事幹,想知道有哪些type是什麼意思,可以查一下:
$ cat /usr/include/scsi/scsi.h|grep TYPE_
#define TYPE_DISK 0x00
#define TYPE_TAPE 0x01
#define TYPE_PROCESSOR 0x03 /* HP scanners use this */
#define TYPE_WORM 0x04 /* Treated as ROM by our system */
#define TYPE_ROM 0x05
#define TYPE_SCANNER 0x06
#define TYPE_MOD 0x07 /* Magneto-optical disk -
* - treated as TYPE_DISK */
#define TYPE_MEDIUM_CHANGER 0x08
#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
#define TYPE_NO_LUN 0x7f
#define TYPE_DISK 0x00
#define TYPE_TAPE 0x01
#define TYPE_PROCESSOR 0x03 /* HP scanners use this */
#define TYPE_WORM 0x04 /* Treated as ROM by our system */
#define TYPE_ROM 0x05
#define TYPE_SCANNER 0x06
#define TYPE_MOD 0x07 /* Magneto-optical disk -
* - treated as TYPE_DISK */
#define TYPE_MEDIUM_CHANGER 0x08
#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
#define TYPE_NO_LUN 0x7f
No comments:
Post a Comment