一块u盘里是个系统镜像,我想把它写到iso文件中

wangxh@mac : ~/file$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk1 on /Volumes/RamDisk (hfs, local, nodev, nosuid, noowners, mounted by wangxh)
/dev/disk2s4 on /Volumes/GRMCULXFRER (msdos, local, nodev, nosuid, noowners)

wangxh@mac : ~/file$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            319.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                            RamDisk                *2.4 GB     disk1
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *4.2 GB     disk2
   1:             Windows_FAT_32 GRMCULXFRER             4.2 GB     disk2s4

/dev/disk2s4是U盘。直接dd会报错

wangxh@mac : ~/file$ sudo dd if=/dev/disk2s4 of=win7.iso 
Password:
dd: /dev/disk2s4: Resource busy

需要先umount掉它,记住它的设备名。

wangxh@mac : ~/file$ diskutil umount /dev/disk2s4
Volume GRMCULXFRER on disk2s4 unmounted

然后再dd即可

wangxh@mac : ~/file$ sudo dd if=/dev/disk2s4 of=win7.iso