# How to view and edit ISO Volume Label with command



## alphachi (Jan 19, 2011)

I know using mkisofs to create an iso file:


```
mkisofs -JR -V MYLABEL -o myiso.iso /mydir/
```

How can I view and edit MYLABEL to another label name with command (not gui)?

Thanks!


----------



## richardpl (Jan 19, 2011)

Edit iso file with editor?

If it is already burned stuff are more complicated.


----------



## alphachi (Jan 19, 2011)

richardpl said:
			
		

> Edit iso file with editor?
> 
> If it is already burned stuff are more complicated.



NO, view and modify the Volume Label of the iso file before burning under ttyv*(not Xï¼‰.


----------



## Beastie (Jan 19, 2011)

alphachi said:
			
		

> NO, view and modify the Volume Label of the iso file before burning under ttyv*(not Xï¼‰.


Where in richardpl's answer did you see he was proposing the use of X-based tools?

You can edit binary files using text-based hex editors, such as editors/hte. Just search the label, modify it and save the file.

Now you probably meant you want an *automated* tool and *not just text-based*. I don't think there's one. But you can always code a patcher in C. Just some basic file I/O and you're done.


----------



## Pushrod (Jan 19, 2011)

I investigated this a few years ago and came back with nothing.

I had a big stack of DVDs, and I wanted to script copying them to disk, in a directory named after the volume name of the disc.

I ended up using this as a workaround.


----------



## wblock@ (Jan 19, 2011)

file(1) will show the volume label in an ISO file.
`% file /tmp/FreeBSD-8.2-RC1-i386-livefs.iso`

```
/tmp/FreeBSD-8.2-RC1-i386-livefs.iso: ISO 9660 CD-ROM filesystem data [B]'FreeBSD_LiveFS                 '[/B] (bootable)
```

vi(1) can edit it in-place.  But you should be concerned about data integrity.


----------



## alphachi (Jan 20, 2011)

Thanks a lot.

I can use command "file" to view the volume label.

I can use editors/bvi or editors/hexedit to modify the volume label. (notice: only modify the ISO9660 label, not Joliet label)

Under X Windows, I can use sysutils/isomaster to do everything.


----------



## richardpl (Jan 20, 2011)

It is time to learn sed(1) & awk(1).


----------



## Beastie (Jan 20, 2011)

richardpl said:
			
		

> It is time to learn sed(1) & awk(1).


Only the GNU versions support a "binary mode", no?


----------



## richardpl (Jan 20, 2011)

sed does not add additional EOF, EOL, not even mentioning formating. And on UNIX there is no distiction between binary and ascii files.


----------



## achix (Feb 28, 2011)

Oopps, just found that one by googling for something I had known but forgot just the same problem. I also found the answer: [CMD="isoinfo"]-d[/CMD] does the exact trick we are looking for. It is a program from the sysutils/cdrtools package.


----------

