LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help mounting a CD-R/DVD-R, then using dd to write to them. (https://www.linuxquestions.org/questions/linux-newbie-8/help-mounting-a-cd-r-dvd-r-then-using-dd-to-write-to-them-4175531665/)

Webtm 01-20-2015 05:49 PM

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.

michaelk 01-20-2015 07:11 PM

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.

scdbackup 01-21-2015 01:15 AM

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 :)

metaschima 01-21-2015 10:48 AM

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


All times are GMT -5. The time now is 12:30 PM.