How to use the command genisoimage (with examples)
- Linux
- December 25, 2023
genisoimage is a pre-mastering program that generates ISO9660/Joliet/HFS hybrid filesystems. It allows users to create ISO images from source directories and supports files larger than 2GiB by reporting a smaller apparent size for ISO9660 filesystems.
Use case 1: Create an ISO image from the given source directory
Code:
genisoimage -o myimage.iso path/to/source_directory
Motivation: The use case allows users to create an ISO image from a specific source directory. This can be useful when you want to create a backup of important files or when you need to distribute a large number of files in a single image.
Explanation:
- genisoimage: The command name.
- -o myimage.iso: Specifies the output file name as “myimage.iso”.
- path/to/source_directory: Specifies the path to the source directory from which the ISO image will be created.
Example output:
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
835 extents written (1 MB)
Use case 2: Create an ISO image with files larger than 2GiB by reporting a smaller apparent size for ISO9660 filesystems
Code:
genisoimage -o -allow-limited-size myimage.iso path/to/source_directory
Motivation: This use case is helpful when you need to create an ISO image with files larger than 2GiB on an ISO9660 filesystem. By using the -allow-limited-size
option, genisoimage will report a smaller apparent size for the filesystem to accommodate these large files.
Explanation:
- genisoimage: The command name.
- -o myimage.iso: Specifies the output file name as “myimage.iso”.
- -allow-limited-size: Allows genisoimage to report a smaller apparent size for the ISO9660 filesystem.
- path/to/source_directory: Specifies the path to the source directory from which the ISO image will be created.
Example output:
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
835 extents written (1 MB)
Conclusion
The genisoimage command provides a flexible solution for creating ISO images from source directories. Whether you need to create a simple ISO image or handle large files on ISO9660 filesystems, genisoimage offers the necessary functionality. By following the provided examples, users can leverage the command to meet their specific needs.