Advertisement
v1ral_ITS

ISO Create [ GENISOIMAGE ]

Apr 22nd, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.06 KB | None | 0 0
  1.  
  2. How-To: Create ISO Images from Command-Line
  3. Creating ISO Images from Files/Directories
  4. For this tutorial we'll use the genisoimage utility, developed as part of the cdrkit project. genisoimage is a command-line tool for creating ISO 9660 filesystem images, which can be burnt after to a CD or DVD using wodim or some other burning tool. To install it open a terminal and type the following as root:
  5.  
  6. apt-get install genisoimage
  7.  
  8. Now, let's use the simplest syntax to create an ISO image out of a directory and its contents:
  9.  
  10. genisoimage -o output_image.iso directory_name
  11.  
  12. The image, called output_image.iso, will have the directory_name as the root folder. In order to create an image out of several files and folders and without a root directory, use this command:
  13.  
  14. genisoimage -o output_image.iso file1 file2 file3
  15.  
  16. This command will create an image which will contain the files file1, file2 and file3 and will have no root directory.
  17.  
  18. Another useful switch to genisoimage is -R, which uses the Rock Ridge protocol to preserve ownership and permission records, enable longer filenames and support symbolic links and device files:
  19.  
  20. genisoimage -R -o output_image.iso file1 file2 file3
  21.  
  22. Creating ISO Images from CDs/DVDs
  23. For this we will use the dd tool, used to create or copy files formatting them using the specified filesystem. First, unmount the device if it is already mounted:
  24.  
  25. # umount /dev/cdrom
  26.  
  27. Your device may have a different name (e.g. /dev/cdrw, /dev/scd0 or such, so replace accordingly). The command to create an image is the following:
  28.  
  29. $ dd if=/dev/cdrom of=~/cd_image.iso
  30.  
  31. Where if and of mean input file and output file, respectively and ~ is your home directory.
  32.  
  33. Additionally, you can create an image from an audio CD with the following command:
  34.  
  35. cat /dev/scd0 > ~/audio_image.iso
  36.  
  37. If you have suggestions or corrections to these tutorials, please contact me at craciun.dan@tuxarena.com or leave a comment on the TuxArena website.
  38.  
  39. Copyright (C) Craciun Dan 2010 under the terms of Creative Commons Attribution-ShareAlike 3.0 Unported License.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement