Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-20-2024, 04:27 AM
|
#1
|
Member
Registered: Oct 2022
Posts: 122
Rep:
|
How to reload a CD/DVD without physically opening the disc tray?
[ Log in to get rid of this advertisement]
After burning an optical disc (CD/DVD/Blu-ray) using K3b with the option not to open the tray, Linux still thinks that a blank disc is inserted.
lsblk still lists the disc as "2K" size:
Code:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sr0 11:0 1 2K 0 rom
Mounting the disc fails:
Code:
mount: /media/username/RAM/disc: wrong fs type, bad option, bad superblock on /dev/sr0, missing codepage or helper program, or other error.
However, K3b correctly shows the disc label. This means that the optical drive and K3b is aware that the disc contains data, but the Linux system outside K3b is unaware of it, until the tray is physically opened and closed.
On Windows, writing to the disc without opening the tray works. Windows Explorer shows the files immediately after finishing.
Is there any way to reload an optical disc on Linux without physically opening the tray? How to make Linux "aware" of the new data on the disc without physically reloading the tray?
Side note: In the title of this post, I used "CD/DVD" instead of "optical disc" or "Blu-ray disc" because "CD/DVD" is the most widely understood, and "disc" can be confused with "hard disk".
And to the criers of "optical discs are obsolete!!1!1!", watch: https://www.youtube.com/watch?v=qbxaPc2Xf5M
Last edited by exerceo; 02-20-2024 at 04:29 AM.
Reason: generic username
|
|
|
02-20-2024, 06:20 AM
|
#2
|
Senior Member
Registered: Jul 2020
Posts: 1,592
|
partprobe?
|
|
|
02-20-2024, 10:25 AM
|
#3
|
Member
Registered: Oct 2022
Posts: 122
Original Poster
Rep:
|
Quote:
Originally Posted by lvm_
partprobe?
|
Didn't work. It caused the optical drive to spin up, but it still appears as "2K".
Code:
$ sudo partprobe /dev/sr0; lsblk /dev/sr0
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sr0 11:0 1 2K 0 rom
Last edited by exerceo; 02-20-2024 at 02:52 PM.
Reason: correct number, dollar sign
|
|
|
02-21-2024, 11:07 AM
|
#4
|
Senior Member
Registered: Oct 2003
Posts: 3,018
|
Your lsblk output indicates the optical drive is not mounted. So just mount it with:
Code:
$ sudo mount /dev/sr0 <mountpoint>
Once mounted, the data on the drive should be accessible without having to eject the optical media. Note, the mount command must be run with admin privileges. Also, if you are writing cd audio to the disk, i.e. you are making a music cd, the disk will not be mountable with the mount command as cd audio disks have no filesystem.
Last edited by kilgoretrout; 02-22-2024 at 07:41 AM.
|
|
|
02-21-2024, 12:11 PM
|
#5
|
Senior Member
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 1,064
|
Maybe rescan the bus? Assuming sr0 as proper device. You should also verify that the disk wrote correctly to rule that out.
Code:
echo "1" > /sys/class/block/sr0/device/rescan
|
|
|
Today, 06:20 AM
|
#6
|
Member
Registered: Oct 2022
Posts: 122
Original Poster
Rep:
|
Solution found!
"Please note that this thread has not been replied to in over 6 months. Please ensure your reply is still relevant and timely." - You bet it is!
The solution is:
Code:
# lsblk /dev/sr0
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sr0 11:0 1 2K 0 rom
# cd /sys/bus/scsi/drivers/sr
# ls
3:0:0:0 bind uevent unbind
# echo 3:0:0:0 >unbind
# echo 3:0:0:0 >bind
# lsblk /dev/sr0
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sr0 11:0 1 46,6G 0 rom
(Requires root access, hence the hash symbols.)
VoilĂ ! There you have it.
Credits go out to Guy Bernard. A bug report he posted to Debian in 2020 contained the solution.
#970805 - Unable to mount after burning a CD with wodim - Debian Bug report logs
Last edited by exerceo; Today at 06:23 AM.
Reason: Clarified that it requires root access.
|
|
|
Today, 07:02 AM
|
#7
|
Member
Registered: Oct 2022
Posts: 122
Original Poster
Rep:
|
K3b unused
Quote:
Originally Posted by exerceo
After burning an optical disc (CD/DVD/Blu-ray) using K3b
|
Oh, by the way, I don't use that anymore. I use command-line tools now because they don't do undesirable stuff in the background like automatically initiating a checksumming of a disc image (IMG or ISO file) when I didn't ask for it. And they can be controlled through functions and scripts.
Command-line tools also have options that are not shown in the graphical interface of k3b, such as spare:none on growisofs and without_spare on xorriso, which doubles the writing speed on Blu-ray by deactivating defect management. Defect management is unnecessary for DAO (disc-at-once) writing a brand new disc. Not to be confused with error correction while reading data, which is always on because there is no reason for it not to be in use.
|
|
|
All times are GMT -5. The time now is 11:44 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|