LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-20-2015, 05:49 PM   #1
Webtm
LQ Newbie
 
Registered: Oct 2014
Distribution: FreeBSD
Posts: 14

Rep: Reputation: 0
Help mounting a CD-R/DVD-R, then using dd to write to them.


I can't seem to mount a CD-R or DVD-R, doesn't matter if it is blank or not.
However, when I use a program such as Brasero, I am able to write to them. I cannot use dd to write to them.

This is the output of trying to mount/unmount.
Code:
root@delarocha-> mount /dev/sr0 /media/cd
mount: /dev/sr0 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sr0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail or so.

root@delarocha-> umount /dev/sr0
umount: /dev/sr0: not mounted
root@delarocha-> umount /media/cd
umount: /media/cd: not mounted
root@delarocha-> umount /media/cdrom
umount: /media/cdrom: not mounted
dmesg | tail
Code:
root@delarocha-> dmesg | tail
[ 1536.299777] sr 1:0:0:0: [sr0]  
[ 1536.299804] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 1536.299809] sr 1:0:0:0: [sr0]  
[ 1536.299814] Sense Key : Illegal Request [current] 
[ 1536.299820] sr 1:0:0:0: [sr0]  
[ 1536.299824] Add. Sense: Logical block address out of range
[ 1536.299829] sr 1:0:0:0: [sr0] CDB: 
[ 1536.299832] Read(10): 28 00 00 00 00 00 00 00 01 00
[ 1536.299846] end_request: I/O error, dev sr0, sector 0
[ 1536.299915] EXT4-fs (sr0): unable to read superblock
I don't think it can be anything wrong with the disk, since it is a untouched disk.
Note: The results of everything(apart from dmesg I would assume), are the same for a CD-R and DVD-R

This is what I get while trying to dd a .iso and .mp4, respectively.

Code:
web@delarocha-> dd if=/dev/sr0 of=~/Downloads/xubuntu-14.04.1-desktop-amd64.iso
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000377316 s, 0.0 kB/s
Code:
web@delarocha-> dd if=/dev/sr0 of=~/Videos/The\ Hobbit/The\ Hobbit\ The\ Desolation\ of\ Smaug.mp4
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000377179 s, 0.0 kB/s
uname -a
Code:
Linux delarocha 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt2-1 (2014-12-08) x86_64 GNU/Linux
When I used lsblk when I close the disk tray, it shows it mounted.
Code:
sr0                     11:0    1     2K  0 rom
But after I use the dd command to write the .iso, it disappears.

Here is my /etc/fstab
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/delarocha-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=5bbedec0-6e3d-4185-91e0-292a72585908 /boot           ext2    defaults        0       2
/dev/mapper/delarocha-swap_1 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/sdb1       /media/usb0     auto    rw,user,noauto  0       0
I have also tried replacing /dev/sr0 in the above commands with /media/cdrom0.

Last edited by Webtm; 01-20-2015 at 05:52 PM.
 
Old 01-20-2015, 07:11 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,729

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
You can not mount blank media nor music CDs. You might want to post your linux distribution / version and explain what you are trying to accomplish.

You can't burn optical media via the dd command. You need to use a burning application like Brasero.

FYI if = input file, of = output file. dd isn't the correct tool for writing to optical media however if you use it for other purposes make sure the syntax is correct or you might corrupt a filesystem and lose data.
 
Old 01-21-2015, 01:15 AM   #3
scdbackup
Member
 
Registered: Oct 2013
Posts: 158

Rep: Reputation: Disabled
Hi,

> But after I use the dd command to write the .iso, it disappears.

As michaelk already stated, your dd commands are up to overwriting and truncating your input files
of=~/Downloads/xubuntu-14.04.1-desktop-amd64.iso
of=~/Videos/The\ Hobbit/The\ Hobbit\ The\ Desolation\ of\ Smaug.mp4
must be if=... and if=/dev/sr0 must be of=/dev/sr0.

It depends on the media type whether dd would work.
Suitable are: DVD-RAM, DVD+RW, BD-RE, formatted DVD-RW, formatted CD-RW.
Not suitable for dd: CD-R, unformatted CD-RW, DVD-R, DVD+R,
DVD+R DL, unformatted DVD-RW, BD-R.

Try with any medium type:

xorriso -as cdrecord -v dev=/dev/sr0 blank=as_needed ~/Downloads/xubuntu-14.04.1-desktop-amd64.iso

This will automatically make written CD-RW and DVD-RW re-usable.

Have a nice day

Last edited by scdbackup; 01-21-2015 at 02:22 AM. Reason: typo: formatted DVD-R -> formatted DVD-RW
 
Old 01-21-2015, 10:48 AM   #4
metaschima
Senior Member
 
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Although you could use 'dd' to write disks, I would recommend using 'cdrecord' and 'growisofs' instead.
 
  


Reply

Tags
burning, debian jessie, dvd+r, linux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Location of the DVD in the /dev directory, for mounting the DVD in SuSE aristocratic Linux - Hardware 6 07-27-2012 04:05 PM
DVD write accept some DVD and reject some... n03x3c Linux - Hardware 2 01-31-2009 11:12 PM
LXer: Howto: Linux write (burn) data to DVD or DVD/RW at shell prompt LXer Syndicated Linux News 0 07-11-2006 03:21 PM
DVD-RW drive can't write a multisession dvd?? bruno buys Linux - Hardware 1 04-05-2005 09:38 AM
k3b & dvd+rw-tools, can't write dvd-r Daliz Linux - Software 28 07-10-2004 08:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration