this post was submitted on 18 Aug 2024
19 points (100.0% liked)

linux4noobs

1340 readers
1 users here now

linux4noobs


Noob Friendly, Expert Enabling

Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.


Seeking Support?

Community Rules

founded 1 year ago
MODERATORS
 

I'm having an issue trying to burn a music CD for use in my (very old, I know I know) car. I'm running FedoraKDE (40) and Brasero, a Liteon brand external optical DVDRW drive, CD-R (TDK brand), and a Framework 16.

The issue I'm having seems to be that the blank disks(maybe?) aren't recognized automatically by Fedora, when I pop a full commercially released CD in it'll play/rip, but with a blank disk nothing happens, and I don't know where to "save" the "image" of this album I'm creating in Brasero to get it on the disk.

Someone on a random linux forum told some other guy to run cdrecord -checkdrive which says my drive is at /dev/sr0 with a blank disk, but that's as far as I've gotten. Do I choose sr0 as the place to save it? It says "something something overwrite" when I try which makes me wary, it seems it wants to overwrite "sr0" itself and either bork my drive or install, but maybe?

I'm positive it's just something simple I'm missing, any help would be greatly appreciated and I can answer questions and run commands if needed (but I don't actually have WIFI rn, so I'll have to have the package for said command already.)

Thanks in advance.

you are viewing a single comment's thread
view the rest of the comments
[–] ArcaneSlime@lemmy.dbzer0.com 1 points 2 months ago* (last edited 2 months ago) (2 children)

Oh cool thanks I'll log out and try again. Ran into another issue in my script I'm trying to work around now though: I disconnected and reconnected the drive, now it's /dev/sr1!

So, I guess I need to have my script run cdrecord -checkdrive, and then take that answer as a variable $CDROM and pump it back into cdrecord -v dev=/dev/$CDROM -audio yadda yadda.

This is getting a liiitle above my head lmao.

Edit: logged out and in, no dice, still sudo. Now to figure out this checkdrive issue...

[–] simplymath@lemmy.world 2 points 2 months ago (1 children)

if you want to take a break, I can ask somebody I know who might have a bit more experience with this.

[–] ArcaneSlime@lemmy.dbzer0.com 1 points 2 months ago (1 children)

I think I need one! Lol, I'll happily take a break, thanks for the help and let me know what your friend says!

[–] simplymath@lemmy.world 2 points 2 months ago (1 children)

I messaged him. No guarantees or anything, but he was my forum guy before I was your forum guy.

[–] ArcaneSlime@lemmy.dbzer0.com 1 points 2 months ago

Thanks! Lol I've been a forum guy once or twice myself but this one is above me!

[–] Kimjongtooill@sh.itjust.works 1 points 2 months ago (1 children)

Ahhh, so apparently in the man page for cdrecord it mentions it needs to be ran as root since it uses "real time scheduling" to write. So even if you have proper permissions to use the cd burner, you still need root to run it. I made a bad assumption that you were having to use root since you didn't have permissions as your use to write to it.

If you don't need to parse the output of "cdrecord -checkdrive" then setting that var is pretty trivial.

CDROM=$(cdrecord -checkdrive)

If that outputs more than just the string you need, that gets a little headachey. Grep/awk/sed/sort/uniq/regex are all very powerful and esoteric.

That being said, the man page also mentions that most users will not have to specify "dev" at all as it should figure it out automatically. So you might be ok with axing the "dev" part of the command instead of feeding it the device path.

[–] ArcaneSlime@lemmy.dbzer0.com 1 points 2 months ago* (last edited 2 months ago) (1 children)

AH! Oh well no harm no foul, I can run my script as root, I trust me!

Cdrecord -checkdrive does output a whole mess of stuff:

Device was not specified. Trying to find an appropriate drive...
Detected CD-R drive: /dev/sr0
Device type    : Removable CD-ROM
Version        : 0
Response Format: 2
Capabilities   : 
Vendor_info    : 'Slimtype'
Identification : 'eNAU108   8     '
Revision       : 'XL0A'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-3 SWABAUDIO BURNFREE FORCESPEED 
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R

And the only part I need is the part that says /dev/sr0/.

I will try deleting the /dev/ part entirely though and see what happens (probably tomorrow evening). If it works that'll be perfect. Thanks!

Edit: No dice, dev=/dev/sr0 is needed in my case.

[–] Kimjongtooill@sh.itjust.works 2 points 2 months ago (1 children)

This is a very goofy workaround for you that doesn't actually check what the device is. Only checks if /dev/sr0 exists and if yes, use that if no then use /dev/sr1. Better solution below this block. But leaving it because I kind of like it's jankiness.

if [ -e /dev/sr0]; then
    DEVICE="/dev/sr0"
else
    DEVICE="/dev/sr1"
fi

Not elegant and a little janky but works.

This will work better. We are taking the output of -checkdrive, searching for "Detected" and sending that to awk. We are telling awk to split that line into columns based on this character ":" and to print the second column. That should give you an output of " /dev/sr0" with a space in front.

DEVICE=$(cdrecord -checkdrive | grep Detected | awk -F ":" '{print $2}')

That should work. But if you absolutely must kill the whitespace for some reason we can add trim to the end like so

DEVICE=$(cdrecord -checkdrive | grep Detected | awk -F ":" '{print $2}' | tr -d ' ')

There might be a more elegant solution by using the output of "cdrecord -scanbus" instead. No clue though since I don't have the hardware to verify from here. Hope that helps!

[–] ArcaneSlime@lemmy.dbzer0.com 1 points 2 months ago

This looks like it'll work perfectly, thank you! When I get home from work I'll play around with -scanbus and see if it works out first, then I'll try with the space and if no dice I'll try without the space!

I'm also going to try k3b and see how that works as another poster was saying, but at this point I think I prefer the script lmao!