LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Not loading sata driver . (https://www.linuxquestions.org/questions/linux-kernel-70/not-loading-sata-driver-676493/)

91change 10-15-2008 08:44 AM

Not loading sata driver .
 
I have an embedded linux box . I am trying to reduce boot time by making so many features as modules . So that i wll have a thin uImage .

I made sata driver (mv_sata ) as a loadable kernel module . But when the
box boots up and trying to mount /dev/sda ( it is a sata harddisk ) . it is failing .

$ fdisk /dev/sda

the above command gives an error message " unable to open /dev/sda"

$ mkfs.ext3 /dev/sda

this commnand also gives the same message " unable to open /dev/sda"

But after loading the driver using
$ modprobe mv_sata

i can do fdisk ,mkfs.ext3 and mount all .

My question is : -> Is there any way linux can load the module by itself if it needs to mount a sata drive ??

GlennsPref 10-15-2008 10:20 AM

You may need to add a line to your /etc/modprobe.preload file or something similar.

Code:

# /etc/modprobe.preload: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line.  Comments begin with
# a `#', and everything on the line after them are ignored.
# this file is for module-init-tools (kernel 2.5 and above) ONLY
# for old kernel use /etc/modules

psmouse
pcspkr
amd64_agp
evdev

Or /etc/modprobe.conf I'm using ahci instead of nv_sata or whatever it was called.
Code:

install scsi_hostadapter /sbin/modprobe ahci; /sbin/modprobe ata_piix; (line continues)
 /sbin/modprobe pata_amd; /sbin/modprobe usb_storage; /bin/true
install usb-interface /sbin/modprobe ehci_hcd; /sbin/modprobe ohci_hcd; /bin/true
options usb_storage delay_use=10 swi_tru_install=1
remove snd_hda_intel /sbin/modprobe --first-time -r --ignore-remove snd_hda_intel
install snd_hda_intel /sbin/modprobe --first-time --ignore-install snd_hda_intel

Hope that helps you, cheers, Glenn

Quakeboy02 10-15-2008 12:01 PM

There doesn't seem to be much point in making a module loadable that you're going to have to load every boot. I guess I don't get it.

GlennsPref 10-15-2008 04:45 PM

From what I recall, you may load it as a module dynamically (handy for joysticks and webcams)

or statically, it's loaded at boot and stays there until further notice (good for /boot and / partitions).

If you need a small kernel, have the modules built in (static),

saving heaps of space because you don't need to have all the
rest of the worlds modules there in case you switch systems, or something.

It will also speed up the boot times, because it won't have to search for the

modules each time you boot it.

To get started, add it to your /etc/modprobe.preload

for my sata drives I am using "/sbin/modprobe ahci". But ahci must be enabled in bios.

Cheers, Glenn

tzp 10-16-2008 05:03 AM

I assume that mv_sata is in your boot image, but not loaded from the ramdisk.

The straightforward option is to build that into the kernel, i.e. not as module.

axobeauvi 10-18-2008 05:52 PM

are you sure ?
 
I'm not sure you are accessing the correct thing
when you do a fsck you point it to a partion not a disk itself
i.e. fsck /dev/sda1 (or whatever partition to check)
try it along those lines ,or create a partition if there isn't one.


All times are GMT -5. The time now is 04:22 PM.