LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   FC9 : DVD ROM detection and writing (https://www.linuxquestions.org/questions/linux-newbie-8/fc9-dvd-rom-detection-and-writing-723476/)

vaibhavs 05-04-2009 02:46 AM

FC9 : DVD ROM detection and writing
 
Hi,

I have Fedora release 9 (Sulphur) in TEXT ONLY mode.

I have a Samsung DVD writer connected to it.

I want to backup my data to a DVD.

I have 2 hurdles:
(a) How do I detect my DVD rom drive and mount it.
(b) How do I write data to the DVD.

I am relatively new.

Please suggest pointers or steps.

Thx
Vai

linterrogate 05-04-2009 02:58 AM

Quote:

Originally Posted by vaibhavs (Post 3529210)
Hi,

I have Fedora release 9 (Sulphur) in TEXT ONLY mode.

I have a Samsung DVD writer connected to it.

I want to backup my data to a DVD.

I have 2 hurdles:
(a) How do I detect my DVD rom drive and mount it.
(b) How do I write data to the DVD.

I am relatively new.

Please suggest pointers or steps.

Thx
Vai

One straightforward way is to look through /var/log/message where the loading kernel detects its hardware

Newer systems usually have some hotplug functionality. You can just insert a dvd, close the drive, and wait for a popup to ask what you want to do with it. Say open and the file manager will show its contents. Now "mount" will show you the name of the device and where it is mounted.

vaibhavs 05-04-2009 03:24 AM

Quote:

Originally Posted by linterrogate (Post 3529218)
One straightforward way is to look through /var/log/message where the loading kernel detects its hardware

Newer systems usually have some hotplug functionality. You can just insert a dvd, close the drive, and wait for a popup to ask what you want to do with it. Say open and the file manager will show its contents. Now "mount" will show you the name of the device and where it is mounted.


I scanned the /var/log/messages but I would not figure-out what to look for and how to idenitfy the DVDROM.

Code:

Apr  5 14:40:08 server smartd[2084]: smartd version 5.38 [i386-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Apr  5 14:40:08 server smartd[2084]: Home page is http://smartmontools.sourceforge.net/#012
Apr  5 14:40:08 server smartd[2084]: Opened configuration file /etc/smartd.conf
Apr  5 14:40:08 server smartd[2084]: Configuration file /etc/smartd.conf parsed.
Apr  5 14:40:08 server smartd[2084]: Device: /dev/sda, opened
Apr  5 14:40:08 server smartd[2084]: Device: /dev/sda, found in smartd database.
Apr  5 14:40:08 server smartd[2084]: Device: /dev/sda, is SMART capable. Adding to "monitor" list.
Apr  5 14:40:08 server smartd[2084]: Monitoring 1 ATA and 0 SCSI devices
Apr  5 14:40:09 server smartd[2086]: smartd has fork()ed into background mode. New PID=2086.
Apr  5 14:41:43 server init: tty1 main process ended, respawning

Is this the DVD ROM ??

What next ??

Thx
Vai

H_TeXMeX_H 05-04-2009 10:49 AM

Here's how I would do it.
First run 'lsscsi':
Code:

bash-3.1# lsscsi
[3:0:0:0]    disk    ATA      ST3160815AS      4.AA  /dev/sda
[5:0:0:0]    cd/dvd  TSSTcorp CDDVDW SH-S203D  SB00  /dev/sr0

So in this case the drive is /dev/sr0. Usually there's a symlink from /dev/cdrom, so you can use that too, but not if you have more than one DVD drive.

You can also find out more info on the drive using:
Code:

cdrecord -prcap dev=/dev/sr0
Now, to burn your data you do NOT need to mount the disk, in fact you can't, it's impossible.

To write the data, read about it here:
http://www.linux.com/feature/113859

Or you can use my script:
http://draconishinobi.50webs.com/sla...ul-scripts.tgz
It's called 'burnit' just run 'burnit directory /dev/sr0'.
Or just run:
Code:

growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0 -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 source_directory
Where source_directory is the directory you want to burn, and with the appropriate speed setting (here it's 1x)

vaibhavs 05-04-2009 10:55 AM

Thx for your details ionstructions.
I am sure it will be of great help.

When I hit lsscsi I got this error.

[root@server ~]# lsscsi
-bash: lsscsi: command not found


Is lsscsi not included in the std FC9 distro or have I stopped some services ??

Thx for your help.

Vai

H_TeXMeX_H 05-04-2009 11:00 AM

It's probably not included, in which case, how many DVD drives do you have ? If only one, then use /dev/cdrom or /dev/dvdwriter those symlinks should be there

vaibhavs 05-04-2009 01:40 PM

I have 1 ROM.

But the output id different.

Code:

[root@server ~]# ll /dev/
Display all 173 possibilities? (y or n)
agpgart            lp0                ram10              shm/                tty24              tty47              ttyS3
audio              lp1                ram11              snapshot            tty25              tty48              .udev/
bsg/                lp2                ram12              snd/                tty26              tty49              urandom
console            lp3                ram13              stderr              tty27              tty5                usbmon0
core                MAKEDEV            ram14              stdin              tty28              tty50              vcs
cpu_dma_latency    mapper/            ram15              stdout              tty29              tty51              vcs1
disk/              mem                ram2                systty              tty3                tty52              vcs2
dm-0                mixer              ram3                tty                tty30              tty53              vcs3
dm-1                net/                ram4                tty0                tty31              tty54              vcs4
dri/                network_latency    ram5                tty1                tty32              tty55              vcs5
dsp                network_throughput  ram6                tty10              tty33              tty56              vcs6
fd/                null                ram7                tty11              tty34              tty57              vcsa
full                nvram              ram8                tty12              tty35              tty58              vcsa1
hpet                oldmem              ram9                tty13              tty36              tty59              vcsa2
input/              parport0            ramdisk            tty14              tty37              tty6                vcsa3
kmsg                parport1            random              tty15              tty38              tty60              vcsa4
log                parport2            root                tty16              tty39              tty61              vcsa5
loop0              parport3            rtc                tty17              tty4                tty62              vcsa6
loop1              port                rtc0                tty18              tty40              tty63              VolGroup00/
loop2              ppp                sda                tty19              tty41              tty7                watchdog
loop3              ptmx                sda1                tty2                tty42              tty8                X0R
loop4              pts/                sda2                tty20              tty43              tty9                XOR
loop5              ram                sequencer          tty21              tty44              ttyS0              zero
loop6              ram0                sequencer2          tty22              tty45              ttyS1
loop7              ram1                sg0                tty23              tty46              ttyS2
[root@server ~]# ll /dev/


vaibhavs 05-04-2009 01:41 PM

The outpur of lsscsi is as follows:

Code:

[root@server ~]# lsscsi
[2:0:0:0]    disk    ATA      WDC WD1600AABS-0 01.0  -
[root@server ~]#

I will just check if the ROM is well connected and showing up in CMOS.

H_TeXMeX_H 05-04-2009 02:46 PM

It doesn't seem to be detected.

vaibhavs 05-05-2009 08:19 AM

Figured out the ROM was not powered & its a CD ROM not DVD :(

Now I see this.

Code:

[root@server ~]# lsscsi
[0:0:1:0]    cd/dvd  SAMSUNG  CD-ROM SH-152A  C501  -
[2:0:0:0]    disk    ATA      WDC WD1600AABS-0 01.0  -

and I see this:

Code:

[root@server ~]# ll /dev/cdrom
lrwxrwxrwx 1 root root 3 2009-05-05 17:06 /dev/cdrom -> sr0

So now I have recognised the ROM.
Now the burning part....

vaibhavs 05-05-2009 08:24 AM

I will try this command to test a burn

Code:

growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0 -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 source_directory
But 1 question, how do I define multiple files & folders in the command ?
Is it like
Code:

source_directory1, source_directory2, source_directory3, source_file
Or is there any other way ?



Thx
Vai

vaibhavs 05-05-2009 12:12 PM

FC9 does not have growisofs

Code:

[root@server ~]# growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0 -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 /var/www/html
-bash: growisofs: command not found
[root@server ~]# which growisofs
/usr/bin/which: no growisofs in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@server ~]#


vaibhavs 05-05-2009 12:15 PM

FC9 does not have "mkisofs" either which is required for "growisofs".

Please help, what utility should I use/install for CD/DVD burning in FC9

Thx
Vai

H_TeXMeX_H 05-05-2009 12:54 PM

You can also use cdrecord to burn a DVD, I've never done it tho, I prefer growisofs. But you'd probably run this:

Code:

mkisofs -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 source_directory | cdrecord -v gracetime=2 dev=/dev/sr0 speed=1 driveropts=burnfree -tao -
To burn more than one directory just list the rest of them after that first one.

But, as you will notice from the above, you cannot backup data files to a data dvd or cd without mkisofs ... you can't make an iso ... therefore what are you gonna burn ? Nothing. Therefore you must first install mkisofs, and I recommend growisofs too.

I believe it's part of the dvd+rw-tools package.

vaibhavs 05-05-2009 01:09 PM

Ok.

dvd+rw-tools package does not include mkisofs
See this:
Code:

[root@server ~]# rpm -ivh dvd+rw-tools-7.0-11.fc9.i386.rpm
error: Failed dependencies:
        mkisofs >= 2.0 is needed by dvd+rw-tools-7.0-11.fc9.i386

So I had to first install genisoimage-1.1.6-11.fc9.i386.rpm & then dvd+rw-tools-7.0-11.fc9.i386.rpm

But this could not burn a CD.

Code:

[root@server ~]# growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0 -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 /var/www/html
:-( /dev/sr0: media is not recognized as recordable DVD: 0


What are my options to burn a CD ?

Thanks for your continued help.
Much appreciated.

BR/Vai

H_TeXMeX_H 05-05-2009 01:31 PM

This seems to be your CD-ROM drive:
http://www.google.com/products/catal...#ps-tech-specs

I assumed it was a DVD burner, but ... it cannot read DVDs, it cannot burn at all (not CDs or DVDs) ... is this the only one you have ?

If this is not your drive then post the output of:

Code:

cdrecord -prcap dev=/dev/sr0
If it is your drive, you need another drive, one that can burn DVDs.

vaibhavs 05-08-2009 08:52 AM

Hi,

Finally I managed to burn my First DVD.

On FC9 I had to do the following in order:

Installed the following rpm for CD/DVD detection and burning
(1) lsscsi-0.19-1.i386.rpm
(2) genisoimage-1.1.6-11.fc9.i386.rpm
(3) dvd+rw-tools-7.0-11.fc9.i386.rpm

My DVD writer was detected as follows:
Code:

[root@server ~]# lsscsi
[2:0:0:0]    disk    ATA      WDC WD1600AABS-0 01.0  -
[2:0:1:0]    cd/dvd  HL-DT-ST DVD-RAM GH22NS30 1.01  -

Not sure why it was not showing /dev/???

Next, run this command to burn a DVD:
Code:

growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0 -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 /var/www/html
My first DVD is ready!!

I hope this small writeup will help other newbies like myself.

Thanks to all forum members for their help.
Special thanks to "H_TeXMeX_H" for his inputs & support.

Best regards,
Vai

vaibhavs 05-08-2009 09:36 AM

I have a quick question.

When I executed the following command, the files & folders from /var/www/html got written on the DVD.
I was expecting the folder "html" to be created on the DVD and then the content to have been copied inside the html folder.

What did I miss ??

Code:

growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0 -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 /var/www/html
Thx
Vai

H_TeXMeX_H 05-08-2009 09:40 AM

Alright, well either way, you can usually use the symlinks made by udev:

/dev/dvdwriter

if there are more than one they will be labeled:

/dev/dvdwriter0
/dev/dvdwriter1

same goes for cdwriter, cdrw, dvdrw, cdrom, dvd

You may also want to read here for more info:
http://www.linux.org/docs/ldp/howto/...-HOWTO/sr.html

If you're using an IDE drive it may be detected as /dev/hdd, while for SATA drives it will be /dev/sr0.

EDIT:

As for your question, that command will write the directory you point it to to the root of the iso, so if you want to keep the html directory, you have to put it in another directory and point it to that. Whatever directory you point it to will not be created, it will became the root or / of the iso, so make sub-directories.

vaibhavs 05-08-2009 09:46 AM

hmm..
How to copy "Folder" (with Files & folder inside)
Rather than copying all files and folders of a folder ??

I hope this is understandable.

Vai

H_TeXMeX_H 05-08-2009 09:48 AM

Sorry I don't get it.

Just do:
Code:

mkdir dvd
mv html dvd

Then burn dvd directory.

vaibhavs 05-08-2009 10:02 AM

Let me explain.

When I wrote my first DVD, the source was defined as -> /var/www/html
I was expecting "growisofs" to create a folder "html" on my DVD and then copy all files inside that folder.
Instead, "growisofs" copied all files from "/var/www/html" into the base of DVD.


OR in simpler words, how can I "folders" on DVD and contents inside the folder

Thx
Vai

vaibhavs 05-08-2009 10:05 AM

Let me give another example:

I have a folder fld1 which contains 3 files.
a.sh
b.sh
c.sh

I would like to copy the entire folder "fld1" to my DVD, such that my DVD should look like this:
/mnt/dvd/fld1/a.sh

H_TeXMeX_H 05-08-2009 10:17 AM

I see, ok you can try this instead:

Code:

growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0 -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 /html/=/var/www/html
see here for description:
http://wiki.archlinux.org/index.php/DVD_writing

vaibhavs 05-08-2009 10:52 AM

hmm. I will try this...

One last question in this series.

Is it possible create a text file with a list of all folders & files which need to be burnt on DVD and then call it from the command prompt.

For example:

File = MyBackupList.txt
Quote:

/html/=/var/www/html
/root/=/root
/Old/=/Old/achives
Then call "MyBackupList.txt" with the "growisofs command.

Thx again for your contants help.

BR/Vai

H_TeXMeX_H 05-08-2009 11:58 AM

I think you can just run:

Code:

growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0 -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 $(sed 's/\n/ /g' MyBackupList.txt)

vaibhavs 05-08-2009 12:49 PM

Surprisingly, I am unable to write more than 200MB of data.
The DVD is a 4.7GB capacity.

What am I missing?

I get this output at the end:
Code:

  5.03% done, estimate finish Fri May  8 23:02:09 2009
 10.05% done, estimate finish Fri May  8 23:02:09 2009
 15.08% done, estimate finish Fri May  8 23:02:09 2009
/dev/sr0: "Current Write Speed" is 4.1x1352KBps.
 20.09% done, estimate finish Fri May  8 23:04:58 2009
 25.11% done, estimate finish Fri May  8 23:04:32 2009
 30.13% done, estimate finish Fri May  8 23:04:15 2009
 35.15% done, estimate finish Fri May  8 23:04:02 2009
 40.18% done, estimate finish Fri May  8 23:03:51 2009
 45.21% done, estimate finish Fri May  8 23:03:44 2009
 50.23% done, estimate finish Fri May  8 23:03:38 2009
 55.24% done, estimate finish Fri May  8 23:03:34 2009
 60.27% done, estimate finish Fri May  8 23:03:30 2009
 65.29% done, estimate finish Fri May  8 23:03:27 2009
 70.31% done, estimate finish Fri May  8 23:03:24 2009
 75.33% done, estimate finish Fri May  8 23:03:20 2009
 80.36% done, estimate finish Fri May  8 23:03:18 2009
 85.37% done, estimate finish Fri May  8 23:03:16 2009
 90.39% done, estimate finish Fri May  8 23:03:15 2009
 95.42% done, estimate finish Fri May  8 23:03:13 2009
Total translation table size: 0
Total rockridge attributes bytes: 1825326
Total directory bytes: 5679104
Path table size(bytes): 30018
Max brk space used e6c000
99566 extents written (194 MB)
builtin_dd: 99568*2KB out @ average 2.2x1352KBps
/dev/sr0: flushing cache
/dev/sr0: closing track
/dev/sr0: closing disc


H_TeXMeX_H 05-08-2009 01:17 PM

I think it wrote all the data you gave it, which was probably 194 MB worth. If you give it more data it will write up to around 4500 MB.

If you want to know the size of what you're gonna be burning run mkisofs this way:

Code:

echo $(mkisofs -print-size -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 $(sed 's/\n/ /g' MyBackupList.txt) 2> /dev/null)*2/1024 | bc
it will give you the size in MB of the data to be written.

vaibhavs 05-29-2009 07:24 AM

Hi,

I am using the below command for writing data to a DVD and its working great in production environment.

Code:

growisofs -dvd-compat -speed=1 -use-the-force-luke=bufsize:32m -Z /dev/sr0
        -graft-points -rational-rock -full-iso9660-filenames -iso-level 2 $(sed 's/\n/ /g' /Backups/scripts/MyBackupList.txt)

I am facing 2 minor issues:

(a) I see a folder called "RR_MOVED".
I do not want this to be written on the DVD.
How can this folder be avoided from writing on the DVD.

(b) How can I set a name/label to the DVD when writing.

Thanks again to forum members for continued support.

Best regards,
Vai

H_TeXMeX_H 05-29-2009 09:29 AM

From the man page:

Code:

      -hide-rr-moved
              Rename  the  directory  RR_MOVED  to .rr_moved in the Rock Ridge
              tree.  It seems to be impossible to completely hide the RR_MOVED
              directory  from the Rock Ridge tree.  This option only makes the
              visible tree better to understand for people who don't know what
              this  directory  is for.  If you need to have no RR_MOVED direc-
              tory at all, you should use the -D option.  Note  that  in  case
              that  the -D option has been specified, the resulting filesystem
              is not ISO9660 level-1 compliant and will not be readable on MS-
              DOS.  See  also  NOTES  section  for  more  information  on the
              RR_MOVED directory.

      -D    Do not use deep directory relocation, and instead just pack them
              in the way we see them.
              If ISO9660:1999 has not been selected, this violates the ISO9660
              standard, but it happens to work on many systems.  Use with cau-
              tion.

Your choice as to which option to use.

Code:

      -V volid
              Specifies the volume ID (volume name or  label)  to  be  written
              into  the master block.  There is space on the disc for 32 char-
              acters of information.  This parameter can also be  set  in  the
              file  .mkisofsrc with VOLI=id.  If specified in both places, the
              command line version is used.  Note that if you assign a  volume
              ID,  this  is the name that will be used as the mount point used
              by the Solaris volume management system and  the  name  that  is
              assigned to the disc on a Microsoft Win32 or Apple Mac platform.

so, add these options after '-iso-level 2'.


All times are GMT -5. The time now is 09:34 AM.