Dvd and Cd
cd
finding the cd drive
cdrecord -scanbus You get a list like :
scsibus2:
2,0,0 200) 'ATA ' 'SAMSUNG HD502IJ ' '1AA0' Disk
2,1,0 201) *
2,2,0 202) *
2,3,0 203) *
2,4,0 204) *
2,5,0 205) *
2,6,0 206) *
2,7,0 207) *
scsibus4:
4,0,0 400) 'LITE-ON ' 'DVD SOHD-167T ' '9S19' Removable CD-ROM
4,1,0 401) 'LITE-ON ' 'LTR-12101B ' 'LS38' Removable CD-ROM
4,2,0 402) *
4,3,0 403) *
4,4,0 404) *
4,5,0 405) *
4,6,0 406) *
4,7,0 407) *
Decide on the one you want to use and remember the number.
Burning the image
So burning it to 'LITE-ON' 'LTR-12101B' would mean :
dvd
ripping dvd
Or find out what the dvd device is, on power you need :
burning (copying) dvd's
This is an ultrashort description of how to burn dvd's on linux: install growisofs
get the data from the dvd as a whole
burning the image
If you want to burn a 'directory':
Note that a command like this :
Will not burn the image to disk but will make a dvd with big.iso on it as the only file
multi session
An easy way to make more use of a dvd's capacity for instance for backup is to incrementally write multiple sessions to the dvd.
You can actually mount the dvd and make it behave like a normal filesystem. For instance if you write file a in session 1 and file b in session 2 you get both of them in the same directory. Even deletion is possible, though i did not try it.
In my case i actually rather have all copies of the backups available so putting them in different directories with a file stamp works just as well.
starting
The first session is special, and should be started like this.
This burns the files inside the aide directory to the root of the cdrom, it does NOT create the aide directory as well.
mount /media/cdrom
ls /media/cdrom
# output :
aide.conf.autogenerated aide.db aide.db.new
more sessions
After that you can add sessions with -M (multi ?)
Now you have a disk with two sessions, and two alternatives to mounting the dvd. You can steer that with the session mount option. In /etc/fstab
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto,ro,session=0 0 0
# umount /media/cdrom
# mount /media/cdrom
# ls /media/cdrom
# aide.conf.autogenerated aide.db aide.db.new
So this gives the state at session 0, only aide files are visible.
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto,ro,session=0 0 0
# umount /media/cdrom
# mount /media/cdrom
# ls /media/cdrom
# aide.conf.autogenerated aide.db.new colatic.twd.bak
# aide.db colatic.twd report
As you see, now both sessions appear in the same directory.
examining sessions
You can get a lot of info by installing and using dvd+rw-tools :
This will list all written tracks and where they reside. It is important to find out if you can isolate a single track or at least a snapshot from earlier. This because a compromised system may be used to destroy the dvd attached and we still end up with no backup.
To get any session you want use this method :
dvd+rw-mediainfo | grep Start
Track Start Address: 0*2KB
Track Start Address: 93952*2KB
Track Start Address: 102736*2KB
Track Start Address: 109088*2KB
Track Start Address: 115440*2KB
Track Start Address: 121792*2KB
Now you will have to guess which one, or just try multiple times. Take the address and mount your section with this commandline :
You will now have the correct 'snapshot' up to that point, not the separate write done. I added the aide configuration files only once in the very first session, and these files will be present in all mounts !! Still this suffices for me, and i will do daily backups to be able to fixate this dvd as soon as possible.