Sunday, May 10, 2020

Create ISO Image From Directory

Occasionally it's useful to create a CD/DVD ISO image from a list of files contained in a directory. For instance, if you're interested in archiving a bunch of files to be later burned to a CD/DVD.
This can be done by using the mkisofs command which stands for 'make ISO filesystem'.

If you have a list of directories like the following:
user@debian:/media/ehd/tmp$ ls -ltotal 2802468drwxr-xr-x 3 root root 4096 2009-12-29 13:01 disc01drwxr-xr-x 3 root root 4096 2009-12-29 13:01 disc02drwxr-xr-x 3 root root 4096 2009-12-29 13:02 disc03drwxr-xr-x 3 root root 4096 2009-12-29 13:03 disc04drwxr-xr-x 3 root root 4096 2009-12-29 13:05 disc05drwxr-xr-x 3 root root 4096 2009-12-29 13:06 disc06drwxr-xr-x 3 root root 4096 2009-12-29 13:08 disc07drwxr-xr-x 3 root root 4096 2009-12-29 13:09 disc08drwxr-xr-x 3 root root 4096 2009-12-29 13:10 disc09drwxr-xr-x 3 root root 4096 2009-12-29 13:10 disc10drwxr-xr-x 3 root root 4096 2009-12-29 13:12 disc11user@debian:/media/ehd/tmp$

You can create individual ISO images for each directory by issuing the following command:
$ mkisofs -o disc02.iso -J disc02

The ISO image will preserve the directory structures and file names found under disc02.

Cheers

No comments:

Post a Comment