HOWTO: Add SATA support for bootup ntfs mounting
发表于 : 2005-07-31 15:46
I know I'm not the only one who has this type of config: ATA/133 drive hosting hoary, SATA drive hosting WinXP (On a Dell if you must know, so ATA/133 is considered master of this config.)
The problem:
When trying to mount /media/windowsC at bootup with the mountall script, an error message is received. This apparently happens because the SATA drive support is not loaded until *after* mountall is already ran.
In my situation, my regular ata drive is considered drive 0. my sata drive is considered drive 1. so ubuntu doesn't want to load support for drive 1 out of the box. this may not happen if the SATA drive is your primary drive. I think this only happens when your primary drive is PATA.
The fix:
Compile a custom kernel with support for SATA drives built in
OR
edit your /etc/mkinitrd/modules file and add these lines to the end:
Code:
ata_piix
libata
sd_mod
scsi_mod
now make a new init ramdisk
Code:
sudo mkinitrd -o /boot/initrd.img-<your version>.custom <your version>
Replace <your version> with your kernel version by using uname -r
After that is done, edit your grub menu list and add the custom ramdisk you just made:
sudo nano /boot/grub/menu.list
Change your first entry to have the ramdisk you just made. Viola!
For reference, here's my fstab, menu.lst, and modules file:
Code:
# /etc/mkinitrd/modules: Kernel modules to load for initrd.
#
# This file should contain the names of kernel modules and their arguments
# (if any) that are needed to mount the root file system, one per line.
# Comments begin with a `#', and everything on the line after them are ignored.
#
# You must run mkinitrd(:cool: to effect this change.
#
# Examples:
#
# ext2
# wd io=0x300
ata_piix
libata
sd_mod
scsi_mod
Code:
# menu.lst - See: grub(:cool:, info grub, update-grub(:cool:
# grub-install(:cool:, grub-floppy(:cool:,
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3
## ## End Default Options ##
title Ubuntu, kernel 2.6.10-5-686-smp.custom
root (hd1,0)
kernel /boot/vmlinuz-2.6.10-5-686-smp root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-686-smp.custom
savedefault
boot
title Ubuntu, kernel 2.6.10-5-686-smp
root (hd1,0)
kernel /boot/vmlinuz-2.6.10-5-686-smp root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-686-smp
savedefault
boot
title Ubuntu, kernel memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
savedefault
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
#title Other operating systems:
#root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 ro,user,noauto 0 0
/dev/hdd /media/cdrom1 udf,iso9660 ro,user,noauto 0 0
/dev/sda1 /media/windowsC ntfs umask=0222 0 0
/dev/sda2 /media/windowsD ntfs umask=0222 0 0
Thanks to zerokarmaleft for all his help in figuring this out. Just wanted to post in case someone else runs into this situation.
http://ubuntuforums.org/showthread.php?t=30233
The problem:
When trying to mount /media/windowsC at bootup with the mountall script, an error message is received. This apparently happens because the SATA drive support is not loaded until *after* mountall is already ran.
In my situation, my regular ata drive is considered drive 0. my sata drive is considered drive 1. so ubuntu doesn't want to load support for drive 1 out of the box. this may not happen if the SATA drive is your primary drive. I think this only happens when your primary drive is PATA.
The fix:
Compile a custom kernel with support for SATA drives built in
OR
edit your /etc/mkinitrd/modules file and add these lines to the end:
Code:
ata_piix
libata
sd_mod
scsi_mod
now make a new init ramdisk
Code:
sudo mkinitrd -o /boot/initrd.img-<your version>.custom <your version>
Replace <your version> with your kernel version by using uname -r
After that is done, edit your grub menu list and add the custom ramdisk you just made:
sudo nano /boot/grub/menu.list
Change your first entry to have the ramdisk you just made. Viola!
For reference, here's my fstab, menu.lst, and modules file:
Code:
# /etc/mkinitrd/modules: Kernel modules to load for initrd.
#
# This file should contain the names of kernel modules and their arguments
# (if any) that are needed to mount the root file system, one per line.
# Comments begin with a `#', and everything on the line after them are ignored.
#
# You must run mkinitrd(:cool: to effect this change.
#
# Examples:
#
# ext2
# wd io=0x300
ata_piix
libata
sd_mod
scsi_mod
Code:
# menu.lst - See: grub(:cool:, info grub, update-grub(:cool:
# grub-install(:cool:, grub-floppy(:cool:,
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3
## ## End Default Options ##
title Ubuntu, kernel 2.6.10-5-686-smp.custom
root (hd1,0)
kernel /boot/vmlinuz-2.6.10-5-686-smp root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-686-smp.custom
savedefault
boot
title Ubuntu, kernel 2.6.10-5-686-smp
root (hd1,0)
kernel /boot/vmlinuz-2.6.10-5-686-smp root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-686-smp
savedefault
boot
title Ubuntu, kernel memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
savedefault
boot
### END DEBIAN AUTOMAGIC KERNELS LIST
# This is a divider, added to separate the menu items below from the Debian
# ones.
#title Other operating systems:
#root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 ro,user,noauto 0 0
/dev/hdd /media/cdrom1 udf,iso9660 ro,user,noauto 0 0
/dev/sda1 /media/windowsC ntfs umask=0222 0 0
/dev/sda2 /media/windowsD ntfs umask=0222 0 0
Thanks to zerokarmaleft for all his help in figuring this out. Just wanted to post in case someone else runs into this situation.
http://ubuntuforums.org/showthread.php?t=30233