How to create a iso image from a folder or single files via terminal commands?
Currently i am doing this via Braseros GUI, but i want to do it with a shell script.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Seems to be pretty straightforward to do with genisoimage, in the package with the same name on Debian:
genisoimage -o output_image.iso directory_name
There are many options to cover different cases, so you should check the man page to see what fits your particular use case.
See also
Method 2
Making a CD from a folder can be performed with mkisofs.
mkisofs -lJR -o output_image.iso directory_name
-l : Allow full 31 character filenames.
-J : Generate Joliet directory records in addition to regular iso9660 file names.
-R : Generate System Use Sharing Protocol (SUSP) and Rock Ridge (RR) records using the Rock Ridge protocol
https://linux.die.net/man/8/mkisofs
https://en.wikipedia.org/wiki/Rock_Ridge
Method 3
Take this basic command of:
mkisofs -o output_image.iso directory_name
One step further, by adding a volume label to the iso, and compressing the iso-image with gzip
mkisofs -V volume_label -r folder_location | gzip > output-image-comressed.iso.gz
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0