我正试图通过grub mkrescue创建一个iso可引导文件。但我需要分配iso的标签。看完手册页后,我想这里有一个正确的命令行,但失败了。
grub-mkrescue -o "my_arch.iso" -- -volid=MY_ARCH my_iso_dir
它将显示错误为:
xorriso 1.4.2 : RockRidge filesystem manipulator, libburnia project.
Drive current: -outdev 'stdio:my_arch.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 19.1g free
Added to ISO image: directory '/'='/tmp/grub.ZoYEzy'
xorriso : UPDATE : 613 files added in 1 seconds
xorriso : FAILURE : -as mkisofs: Unrecognized option '-volid=MY_ARCH'
xorriso : UPDATE : 613 files added in 1 seconds
xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
根据"info grub mkrescue"文件:
All arguments not explicitly listed as 'grub-mkrescue' options are
passed on directly to 'xorriso' in 'mkisofs' emulation mode. Options
passed to 'xorriso' will normally be interpreted as 'mkisofs' options;
if the option '--' is used, then anything after that will be interpreted
as native 'xorriso' options.
Non-option arguments specify additional source directories. This is
commonly used to add extra files to the image:
xorriso的-as-mkisofs仿真可以理解
-V MY_ARCH
或
-volid MY_ARCH
但不是
-volid=MY_ARCH
进一步注意,您显然使用的是grub mkrescue不符合您引用的文档。此版本要求"--"作为grub mkrescue选项之间的分隔符和xorriso-作为mkisofs选项。
但是,如果旧grub mkrescue shell脚本的论点中有"--"或者当前的grub mkrescue C程序,那么你将退出mkisofs仿真。这将为您赢得一条错误消息
xorriso : FAILURE : Not a known command: 'my_iso_dir'