Friday, December 08, 2006

Burning CD for Linux and in Linux

Reference:
1. http://linuxlab.dk/tipsntricks/cdburning
2. http://sourceforge.net/projects/jcdwriter/

Burning CD/DVD for Linux and in Linux is quite a challenging experience.

Oracle softwares are downloaded in cpio format and come in multiple disks. It is disk space and time consuming to extract each cpio each time. So, my idea is to create 1 DVD to consist of all multiple CDs, hence save the trouble to swap disks.

For example, DVD_ROOT:
+ AS1012
+ Disk1
+ Disk2
+ Disk3
+ Disk4
+ AS1013
+ Disk1

Intuitively I simply extracted cpio in Linux, ftp the extracted files to Windows, then use Roxio CD Creator to burn DVD.

Problem: Windows-burned DVD has lost the ownership and execution privilege of all files. I cannot simply “runInstaller” off the DVD. The DVD is useless.

Hence, the next plan is to burn DVD directly on Linux and hope that Linux will keep the correct execution privilege.

By default, Linux has already come with 2 command line utilities to produce CD/DVD:
1. mkisofs - create the iso image of the files.
2. cdrecord - burn CD from iso image.

There are 3 steps to produce CD in Linux:

1. Produce ISO image.

% mkisofs -graft-point -R -J -l -D -o /tmp/filename.iso /AS1012/=/tmp/OracleAS/AS1012/ /AS1013/=/tmp/OracleAS/AS1013/

... where,
-J : Generate Joliet directory records in addition to regular iso9660 file names. This is primarily useful when the discs are to be used on Windows-NT or Windows-95 machines. The Joliet filenames are specified in Unicode and each path component can be up to 64 Unicode characters long.

-l: Allow full 31 character filenames.

-D: Do not use deep directory relocation, and instead just pack them in the way we see them.

The above 3 arguments are necessary. Otherwise default Linux-burned CD will have seriously messed-up filename (capitalized and truncated) and directory structure (relocated deep directory).

2. Detect the CD-Writer.

% cdrecord -scanbus
Cdrecord-Clone 2.01-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2004 JÃrg Schilling
Note: This version is an unofficial (modified) version with DVD support
scsibus2:
2,0,0 200) '_NEC ' 'DVD_RW ND-1300A ' '1.0B' Removable CD-ROM
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) *


3. Burn CD from ISO image.

% cdrecord -v dev=2,0,0 speed=2 --eject /tmp/filename.iso

... where
dev=devicename:scsibus,target,lun is the id of the CD-Writer scanned from step 2.
--eject: Eject after burned CD.

No comments: