burning and converting
Backing up Some Directories to DVD
Start with I give the syntax to create the iso image backup.iso
$ mkisofs -o backup.iso -r -J /home/andrew
Now say that I really don’t want to include the sub-directory /home/andrew/source in this image and I also want to add a few more directories but I would like to map them to the DVD in a slightly different structure:
# mkisofs -o backup.iso -r -J \
-x /home/andrew/source \
-graft-points "my_files/=/home/andrew" "configuration_files/=/etc" \
"cron_files/=/var/spool/cron/crontabs"
Now I would like to add a volume label to the DVD so that my system will identify it by a recognisable label, in this case the backup date. I will also add my own name here as the publisher of this DVD:
# mkisofs -o backup.iso -r -J -V "Backup `date +"%d %B %Y"`" \
-x /home/andrew/source -publisher "Andrew Strong" \
-graft-points “my_files/=/home/andrew” “configuration_files/=/etc” \
“cron_files/=/var/spool/cron/crontabs”
The final addition to the mkisofs syntax is designed to hide the directory RR_MOVED from sight, a directory created when Rock Ridge has to move a lot of files around in deep directory structures. But in a bonus for you, Gentle Reader, I also add the growisofs command to burn the iso image to DVD in a single command:
# growisofs -dvd-compat -speed=1 -Z /dev/dvd \
-r -J -hide-rr-moved -V "Backup `date +"%d %B %Y"`" \
-x /home/andrew/source -publisher "Andrew Strong" \
"cron_files/=/var/spool/cron/crontabs"
-graft-points "my_files/=/home/andrew" "configuration_files/=/etc" \
growisofs is of course a frontend for mkisofs and thus uses the same commands. And there you have it, a backup DVD that is readable on both Linux and Windows. The many, many other options available in mkisofs I will leave you, Gentle Reader, to explore on your own. Again I wish you all the best with your burning and remember: keep it legal!
Making Copies of Your Favourite Linux
DVD to the HDD and convert it to iso:
$ dd if=/dev/dvd of=my_distro.iso bs=2048
Mount ISO to extract files
# mount -o ro,loop -t iso9660 my_distro.iso /mnt/tmp (mount an ISO)
# umount /mnt/tmp (unmount an ISO)
Burn the iso image to a fresh DVD
$ growisofs -dvd-compat -Z /dev/dvd=file.iso
Burning and converting
Burnig and Creating images,copies …..
creating an iso image of afile
1. mkisofs -J -v -o zend.iso /home/installation/Zend-Studio-5.5/
2. dd if=/dev/hdx of=/dev/hdy
3. dd if=/dev/hdx of=/path/to/image
4. dd if=/dev/hdx | gzip > /path/to/image.gzand Related topics
# dd –help
For more options check dd man page
full hard disk copy
dd if=/dev/hdx of=/dev/hdy
dd if=/dev/hdx of=/path/to/image
dd if=/dev/hdx | gzip > /path/to/image.gzHdx could be hda, hdb etc. In the second example gzip is used to compress the image if it is really just a backup.
Restore Backup of hard disk copy
dd if=/path/to/image of=/dev/hdx
gzip -dc /path/to/image.gz | dd of=/dev/hdx
MBR backup
In order to backup only the first few bytes containing the MBR and the partition table you can use dd as well.
dd if=/dev/hdx of=/path/to/image count=1 bs=512
MBR restore
dd if=/path/to/image of=/dev/hdx
Add “count=1 bs=446” to exclude the partition table from being written to disk. You can manually restore the table.
Linux / Unix Command: dd
Command Library
NAME
dd – convert and copy a file
SYNOPSIS
dd [OPTION]…
DESCRIPTIONCopy a file, converting and formatting according to the options.
bs=BYTES
force ibs=BYTES and obs=BYTES
cbs=BYTES
convert BYTES bytes at a time
conv=KEYWORDS
convert the file as per the comma separated keyword list
count=BLOCKS
copy only BLOCKS input blocks
ibs=BYTES
read BYTES bytes at a time
if=FILE
read from FILE instead of stdin
obs=BYTES
write BYTES bytes at a time
of=FILE
write to FILE instead of stdout
seek=BLOCKS
skip BLOCKS obs-sized blocks at start of output
skip=BLOCKS
skip BLOCKS ibs-sized blocks at start of input
–help
display this help and exit
–version
output version information and exitBurning Audio CDs using cdrecord
Burning audio CDs using
cdrecord
is a piece of cake, too. Just follow these steps:
- Create your audio tracks and store them as uncompressed, 16-bit stereo .wav files.
- Name the audio files in a manner that will cause them to be listed in the desired track order when listed alphabetically, such as 01.wav, 02.wav, 03.wav, etc.
- Change into the directory containing the wave files and make sure there are not any wave files you do not want included in the CD.
- With a blank CD in your burner, issue the following command:
cdrecord -v -pad speed=1 dev=0,0,0 -dao -audio -swab *.wav
Again, you may need to adjust your
dev
parameter as mentioned earlier.
Writing an ISO to a CD-ROM using cdrecord
Assuming that all you want to do is create a CD based on the ISO 9660 file system standard, you can quickly burn the CD using the following command:
cdrecord -v dev=2,0,0 speed=16 -data /home/ubuntu.iso
src.iso is the source filename of the ISO you are burning to the CD-ROM.