Linux/UNIX:从CD和ISO镜像中查找卷信息
时间:2020-01-09 10:38:45 来源:igfitidea点击:
问题描述:我可以使用dd命令从CD创建ISO镜像,但是如何从CD取得卷信息以及从Shell提示符获得ISO镜像?
解决方法:您可以使用以下命令:
file
确定文件类型。dd
转换和复制命令。cdrecord
用来从主机记录音频或数据光盘或数字多功能磁盘。isoinfo
一个实用程序,用于执行类似于iso9660图像列表的目录。cd-discid
用来读取CD并获取CDDB Discid信息。
读取未挂载的CD卷数据
使用以下命令:
file -s /dev/scd0
输出示例:
/dev/scd0: ISO 9660 CD-ROM filesystem data UDF filesystem data (unknown version, id 'NSR01') 'Ubuntu 7.04 i386 ' (bootable)
读取未挂载的CD内容表
使用cdrecord:
cdrecord -v dev=/dev/scd0 -toc
输出示例:
TOC Type: 1 = CD-ROM scsidev: '/dev/scd0' devname: '/dev/scd0' scsibus: -2 target: -2 lun: -2 Linux sg driver version: 3.5.27 Wodim version: 1.1.6 SCSI buffer size: 64512 Device type : Removable CD-ROM Version : 5 Response Format: 2 Capabilities : Vendor_info : 'TSSTcorp' Identification : 'CD/DVDW SH-S182D' Revision : 'SB04' Device seems to be: Generic mmc2 DVD-R/DVD-RW. Current: 0x001A (DVD+RW) Profile: 0x0015 (DVD-R/DL sequential recording) Profile: 0x0016 (DVD-R/DL layer jump recording) Profile: 0x002B (DVD+R/DL) Profile: 0x001B (DVD+R) Profile: 0x001A (DVD+RW) (current) Profile: 0x0014 (DVD-RW sequential recording) Profile: 0x0013 (DVD-RW restricted overwrite) Profile: 0x0012 (DVD-RAM) Profile: 0x0011 (DVD-R sequential recording) Profile: 0x0010 (DVD-ROM) Profile: 0x000A (CD-RW) Profile: 0x0009 (CD-R) Profile: 0x0008 (CD-ROM) Profile: 0x0002 (Removable disk) Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd). Driver flags : SWABAUDIO BURNFREE Supported modes: PACKET SAO Drive buf size : 917504 = 896 KB Beginning DMA speed test. Set CDR_NODMATEST environment variable if device communication breaks or freezes immediately after that. Current Secsize: 2048 HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction. first: 1 last 1 track: 1 lba: 0 ( 0) 00:02:00 adr: 1 control: 4 mode: -1 track:lout lba: 2295104 ( 9180416) -1:59:74 adr: 1 control: 7 mode: -1
读取ISO镜像的卷数据
输入以下命令:
isoinfo -d -i /path/to/file.iso isoinfo -d -i ubuntu-8.04-desktop-i386.iso
输出示例:
CD-ROM is in ISO 9660 format System id: LINUX Volume id: Ubuntu 8.04 i386 Volume set id: Publisher id: Data preparer id: Application id: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 357949 El Torito VD version 1 found, boot catalog is in sector 162 Joliet with UCS level 3 found Rock Ridge signatures version 1 found Eltorito validation header: Hid 1 Arch 0 (x86) ID '' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 4 Bootoff 9B 155
从卸载的CD中查找唯一的磁盘号
执行命令,如下所示:
cd-discid /dev/scd0
输出示例:
023bfd01 1 150 15359