GNU/Linux >> Linux の 問題 >  >> Linux

コマンド ラインから .iso ファイルのボリューム ID を変更する方法はありますか?

ボリューム ID は常にオフセット 0x8028 に 32 バイトの ASCII 文字列として格納されます。その場で編集してください。

#!/usr/bin/perl
use strict;
use warnings;

die "Use: $0 <iso_file> <new volume id>\n" unless @ARGV == 2;
open my $file, "+<", $ARGV[0] or die "Cannot open: $!";
seek $file, 0x8028,0;
printf $file "%-32.32s", uc($ARGV[1]);

テスト - (isovolid.pl は上記のスクリプトの名前です):

$ genisoimage -V A123456798012345678901234567890X -o aaa.iso *
$ isoinfo -d -i aaa.iso | grep 'Volume id:'
Volume id: A123456798012345678901234567890X
$ ./isovolid.pl aaa.iso NEWVOLUMEID
$ isoinfo -d -i aaa.iso | grep 'Volume id:'
Volume id: NEWVOLUMEID

xorriso はこれを行うことができます:

$ xorriso -dev ./VBoxGuestAdditions.iso -volid 'YourLable' -commit
xorriso 1.4.6 : RockRidge filesystem manipulator, libburnia project.

xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 32 nodes read in 1 seconds
Drive current: -dev './VBoxGuestAdditions.iso'
Media current: stdio file, overwriteable
Media status : is written , is appendable
Media summary: 1 session, 29111 data blocks, 56.9m data, 20.3g free
Volume id    : 'VBOXADDITIONS_5.1.34_121010'
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
ISO image produced: 27 sectors
Written to medium : 192 sectors at LBA 29120
Writing to './VBoxGuestAdditions.iso' completed successfully.

xorriso : NOTE : Re-assessing -outdev './VBoxGuestAdditions.iso'
xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 32 nodes read in 1 seconds
Drive current: -dev './VBoxGuestAdditions.iso'
Media current: stdio file, overwriteable
Media status : is written , is appendable
Media summary: 1 session, 29147 data blocks, 56.9m data, 20.3g free
Volume id    : 'YourLable'
$ 

Linux
  1. コマンドラインからIcewmを再起動する方法は?

  2. コマンドラインからソフトウェアソースを変更しますか?

  3. wget コマンドを使用してコマンド ラインからファイルをダウンロードするにはどうすればよいですか?

  1. コマンドラインから.pdf画像をフラット化する方法は?

  2. Linux でコマンドラインを使用して起動可能な ISO から起動可能な USB を作成する方法は?

  3. コマンド ラインからファイルにテキストを追加する最も簡単な方法は何ですか?

  1. コマンドラインからタイムゾーン設定を変更するにはどうすればよいですか?

  2. コマンドラインからPerl/PHPスクリプトを実行する

  3. コマンドラインからのLinuxサーバーの移行