# [solved] Trouble recognizing cd/dvd drive

## PCC322

My computer is not recognizing discs in my cd/dvd drive.  Nothing is showing up with 

```
 lsblk 
```

 except for my sda partitions.  Looking through the Gentoo handbook it looks like I may have missed a setting in the kernel needed for cd drives.  I believe that I updated this in the kernel config but I am not sure if I went through the correct process to make and apply the new kernel.Last edited by PCC322 on Sun Jul 28, 2019 5:51 am; edited 1 time in total

----------

## NeddySeagoon

PCC322,

What does 

```
uname -a
```

tell?

```
$ uname -a 

Linux NeddySeagoon_Static 5.1.1-gentoo #1 SMP PREEMPT Sun May 12 09:46:42 BST 2019 x86_64 AMD Phenom(tm) II X6 1090T Processor AuthenticAMD GNU/Linux
```

The Sun May 12 09:46:42 BST 2019 there is the build time of the running kernel.

That's OK for me.

You look at the build time of your running kernel and work out if you have a newer kernel or not.

If you do, its not yet in use.

----------

## PCC322

It is looking like I am still using the old kernel.

----------

## PCC322

In kernel configuration, I am looking at the Serial ATA and parallel ATA drivers, is there a way to know which drivers I should enable for my CD/DVD drive?

I am using an old Toshiba AMD laptop so I am assuming some of the things like SATA port multiplier support is not going to be relevant.

Would there be harm, other than consuming a lot of time, to enabling all of these driver, getting the drive and software up and running, then disabling options until I find on that causes the drive to stop working?

----------

## NeddySeagoon

PCC322,

The output of

```
lspci
```

will tell.

At least, that will (indirectly) tell the chipset driver. 

After that its

```
  │ │    <*> SCSI CDROM support     

  │ │    [ ]   Enable vendor-specific extensions (for SCSI CDROM) 
```

You may want the second option there. Its harmless bloat if you don't need it.

-- edit --

```
<*> SCSI generic support
```

is needed for writing blank optical media.

----------

## PCC322

Looks like I have an AMD sb600 for IDE and SATA.  I enabled what seemed to be the only AMD driver option in the kernel.  I am making the kernel now and saw a bunch of entries of "unmet direct dependency detected", should I be concerned?  It seems to be proceeding normally after that initial bit.

----------

## NeddySeagoon

PCC322,

"unmet direct dependency detected" means that there is something configured in your kernel that needs something else that is not selected.

Your kernel will be broken.

Exactly how did you configure your kernel? 

The wrong answer is that you used you favourite text editor.

The kernel configuration tools can flip over half a dozen .config options for one change.

----------

## PCC322

I used the 

```
 make menuconfig 
```

 interface as instructed in Gentoo install handbook.

----------

## NeddySeagoon

PCC322,

```
make menuconfig
```

 is one of the right answers. There are other kernel config tools too.

Does the date command show the current date and time?

The make step will get in a mess if your time ever steps backwards.

If in doubt, start with 

```
make clean
```

this removes all the binary files created as a result of a previous make.

----------

## PCC322

Date command is returning the correct time and date.

I ran 

```
 make clean 
```

 guess I will try it again.

I have been getting an error printing in my terminal periodically which I have not yet attempted to fix:

```
 syslogd: /var/log/news/news.crit: No such file or directory 
```

 and three more similar lines, could this be throwing off my kernel setup?

----------

## NeddySeagoon

PCC322,

I'm not a systemd user but I don't think that will be an issue.

The kernel build does nothing outside of the kernel source tree itself

----------

## PCC322

 *NeddySeagoon wrote:*   

> PCC322,
> 
> I'm not a systemd user but I don't think that will be an issue.
> 
> The kernel build does nothing outside of the kernel source tree itself

 

Okay, though I don't think it is systemd as I have not emerged anything with systemd support as best I can tell.

----------

## PCC322

I tried again but am still getting messages about unmet dependencies.  I noticed that I get a sort of scrambled  screen when I save from menuconfig, screenshot here;

[img]https://i.postimg.cc/hJhbcBxj/20190720-023246.jpg[/img]

Is there a way to load the settings used on the kernel I am presently using into menuconfig and see what happens changing one setting at a time?

----------

## NeddySeagoon

PCC322,

The kernel .config you are presently using is available at /proc/config.gz if you have that kernel option on in the running kernel.

Its also in the top level of the old kernel tree as .config.

Copy the .config file from one kernel tree to the other, then run 

```
make oldconfig
```

 in the new kernel.

oldconfig does three things

It drops .config symbols that have disappeared

It leaves existing settings untouched

It asks you to choose setting for new options

oldconfig also hints at new settings with the capital letter in the prompt.

The capitals are the default settings in the new kernel.

If you start with the compressed  /proc/config.gz, you need to decompress it before the kernel make system will use it.

The scrambled video is nothing to worry about. What actually happens behind the scenes is corrert.

The video driver is drawing the screen incorrectly.

Its one of a class of features called 'video artefacts'. 

They are all harmless but ugly.

----------

## PCC322

 *NeddySeagoon wrote:*   

> PCC322,
> 
> The kernel .config you are presently using is available at /proc/config.gz if you have that kernel option on in the running kernel.
> 
> Its also in the top level of the old kernel tree as .config..

 

I don't have a config.gz (or anything similar) in /proc, I should make a point of enabling that go through the kernel again.

What is the old kernel tree?  Is that in /usr/src/linux?  There is a file called .config (the saved setting from the last time I ran make menuconfig that resulted in unmet dependencies)  and also a .config.old.  I am not sure what .config.old is.

----------

## PCC322

So I decided to use 

```
 make defconfig 
```

 to start from a default configuration, which produced settings which I was able to make (compile?), then went through the menuconfig to set up the kernel following the install Handbook and the CDROM entry in Gentoo wiki, making less of an effort that I did initially to disable things I didn't think I would need figuring I can go though it again later, or not.  I ran 

```
 make install 
```

.  In /boot I have config-4.19.52-gentoo, System.map-4.19.52-gentoo, vmlinuz-4.19.52-gentoo, and .old versions of each of these.  Despite following the Handbook for GRUB2, I didn't have a grub directory in /boot, though I do now, inside of which I have a .cfg file which, if I am readying the code correctly, I should have option for the current kernel, the .old kernel, and recovery mode for each under the advanced options.  However, when I am booting and get to GRUB I only have the current kernel, which was the initial one I compiled.  I am thinking I might have GRUB working for a different directory than /boot.

----------

## NeddySeagoon

PCC322,

You must make sure that /boot is mounted for the 

```
make install
```

Its not mounted by default in Gentoo.

If you are installing a new (different version) and not overwriting an old kernel, you need to tell grub about it.

There is a command to rewrite your grub.cnf. I'm still on old grub.

Lastly, you new kernel may be on the advanced menu in grub and not your default kernel.

----------

## PCC322

 *NeddySeagoon wrote:*   

> PCC322,
> 
> You must make sure that /boot is mounted for the 
> 
> ```
> ...

 

For this I would 

```
 mount sda0 /boot 
```

, or something to that effect, after doing so I will likely see the /boot/grub directory with grub.cfg?

----------

## NeddySeagoon

PCC322,

```
mount /boot
```

should work as boot should be defined in /etc/fstab

----------

## PCC322

Well, I am sort of making some progress, I was able to mount /boot but needed to use 

```
 mount /dev/sda2 /boot 
```

 because 

```
 mount /boot 
```

 returns an error for wrong fs type, bad option, bad superblock on /dev/sda2, etc.  However, with /boot mounted I was able to make the kernel and grub to boot with it and was able to verify it was a new kernel.  However, I am still not able to get sr0 to show up with lsblk.

I booted from the install medium, which showed /dev/sr0, though when I attempted it mount it, it returned an error about being unable to read superblock on sr0.

Where should I start looking now?

----------

## NeddySeagoon

PCC322,

If mount /boot failed, you have an error in the /boot entry in /etc/fstab. 

/dev/sr0 is your CD drive. Was there a CD in the drive?

Audio CDs do not have a filesystem, so cannot be mounted. They are played using raw block lists.

DVDs (films) usually have two filesystems, ISO9660 and UDF. They are both deliberately corrupt and again, successful replay uses raw block lists.  

DVDs can usually be mounted though.

If your own kernel has /proc/config.gz decompress it and post it on a pastebin.

Give us the link.

If you don't have /proc/config.gz pastebin youur kernel .config file.

To play audio CDs and DVDs, your user needs to be in the cdrom group.

To write optical media, cdrw membership is required.

----------

## PCC322

I got my drive working.  After going through some trouble learning how to configure and install a new kernel, I basically included every sata/pata driver that wasn't experimental in the kernel and am now able to mount data CDs.  I guess I can now spend time disabling all the stuff I just enabled and try to determine which drivers I actually needed.

----------

## NeddySeagoon

PCC322,

The output of 

```
lspci -k
```

will take most of the guesswork out of the kernel pruning.

----------

