xorriso: how to build an iso image file
I'm trying to create an iso image with xorriso. I am having trouble. Part of the trouble is the man page: I can't wrap my head around it.
What I cannot figure out how to do is to copy from a directory or directories onto a ISO file. The following (these are not the actual commands, I've made them up for clarity) is a specific example of what I want to accomplish: Code:
xorriso \ Code:
bagles bubbles stuff Thank you. p.s. I've tried the mkisofs compatibility version (xorissofs) and it fails to understand the --graft-points command. |
you should take a look at some of Erics scripts the on in question is the mirrior and build dvd or cdrom or what ever.
http://www.slackware.com/~alien/tools/ you will see the mkisofs comand used at it fullest mirror-slackware-current.sh you will find it easy |
Hi,
-graft-points of the mkisofs emulation works if you do not write it with double dash (--graft-points). I would translate your pseudo-code example of a run in xorriso command language to: Code:
xorriso \ If you want to truncate the file to the length of the new ISO, you have to delete it by e.g. "rm" before running xorriso. Rock Ridge is on by default. ISO 9660 / ECMA-119 cannot be disabled. File timestamps and permissions are preserved by default. If this is a backup run, then i would use as first command in the list of xorriso commands: Code:
-for_backup It records MD5s which later can be checkread. It also records xattr or ACL if present on disk, which xorriso later can restore if desired. It marks hardlink families which xorriso can later restore so they are hardlinks again. With a more complicated command list in a run, one would have to keep in mind that the native xorriso commands are executed in sequence like shell commands. I.e. you first need to aquire the output drive (in this case the ISO) and make sure it is empty, to get a loaded empty ISO model into which you can map files. (You could also remove some files from the ISO after mapping their directories. Or you could equip them by content filters for encryption or compression.) In mkisofs compatibility mode this would be: Code:
xorrisofs \ writing begins. As with mkisofs, the sequence of options does not matter much. If you use an option twice, then normally the second one prevails. (This is easier to grasp than the native commands, but also ambiguous if you want to make more elaborate ISO manipulations.) Have a nice day :) Thomas |
@scdbackup
Thank you. That worked (your first command line is what I used). It had never occured to me that the image file name could be used as the output device. :o It is tricky how order matters: putting '-blank "as_needed"' before the -outdev resulted in an error message. One minor thing: the ownership of the files & directories in the iso was apparently left as the original owner. I remember that mkisofs would change this to a sane or generic value so that whoever mounted the resultant image or CD would see themselves as the owner? Unless the way I mounted the iso affects the apparent owner & group of files? Code:
mount -o ro a_dvd_image.iso temp as root I was confused at your mention of backup. My task is to simply take several directories and put them onto a data CD/DVD. Anyway, again, thanks for the helpful information. :) |
Hi,
> It had never occured to me that the image file name could be used > as the output device. I thought it is easy to use because you can replace the name of your ISO image by e.g. /dev/sr0 to use optical media directly. > It is tricky how order matters: putting '-blank "as_needed"' before > the -outdev resulted in an error message. Think of xorriso's native commands like of shell commands. You cannot erase all files in a filesystem before you mounted it. Sequential command execution is necessary to express image manipulations unambiguously. It matters whether you remove a directory before or after you give a command that creates it with some files in it. Said this, there is option -x which, if among the xorriso commands, causes automatic command sorting according to the list which you can get by Code:
xorriso -list_arg_sorting > was apparently left as the original owner. One would not want that for backups which shall be able to restore as much as possible of the original files, if needed. > I remember that mkisofs would change this to a sane or generic value > so that whoever mounted the resultant image or CD would see themselves > as the owner? Seeing oneself as owner (i.e. varying without changing the ISO) is a matter of system command mount(8) with filesystem driver "iso9660": Code:
uid=value and gid=value appear as owned by the desktop user. The mkisofs-ish option -r sets owner and group id to 0. On Debian this is the user "root". Others have more or less abandoned that user id. This option also sets the files to read-only and read permission for all. In xorriso's native command language one would apply such a change by manipulation commands after the files where put into the ISO model by command -map or others. E.g. give two directory trees to user "nobody" (id 65534 on my system) and group id 24, then do to /bagles and the files underneath what mkisofs option -r does. Code:
...map.commands... a variable number of parameters. If you plan elaborate manipulations, consider to explore them in dialog mode. Code:
xorriso -abort_on NEVER -dialog on -page 16 80 parameters. See also the third example in https://www.gnu.org/software/xorriso....html#EXAMPLES There are commands for inspecting the result before writing happens. E.g. Code:
-lsl /bubbles -- Code:
-rollback_end > Maybe actually burning the image will tell me more. It should not make a difference to Linux whether you give mount the ISO as image file or as "CDROM" device. But maybe a desktop automounter makes a difference. Whatever, xorriso can burn it for you: Code:
xorriso -as cdrecord -v -eject fs=32m blank=as_needed dev=/dev/sr0 a_dvd_image.iso I use it mainly for high fidelity backups on BD media. Another important job of xorriso is to create the bootable installation ISOs of various GNU/Linux distros. Have a nice day :) Thomas |
Thank you very much. Physical DVD came out correctly and as per my goal. :)
|
All times are GMT -5. The time now is 05:49 AM. |