HOWTO: Add SATA support for bootup ntfs mounting

参与到Ubuntu的翻译中来
回复
yongyi
帖子: 3025
注册时间: 2005-05-07 23:57
送出感谢: 0
接收感谢: 0
联系:

HOWTO: Add SATA support for bootup ntfs mounting

#1

帖子 yongyi » 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
独自看一看大海
总想起身边走在路上的朋友
Lenovo E290-420[Celeron-M420/256M/60G/Intel GMA950]
lattice
帖子: 36
注册时间: 2005-07-06 18:01
送出感谢: 0
接收感谢: 0

#2

帖子 lattice » 2005-08-01 12:56

HOWTO:在启动时挂载NTFS文件系统的SATA(串行ATA)设备

我知道我并不是使用如下配置的第一人:ATA/133硬盘运行hoary,SATA(串行ATA)硬盘运行WinXP(你应该知道在Dell机上ATA/133被认为是主流配置)。

问题:

我想在启动的时候让挂载脚本自动挂载/media/windowsC,结果发生了错误。显然,这是因为挂载时还没有加载SATA的驱动。

根据我自己机器的实际情况,我的ATA硬盘被识别为硬盘驱动器0(drive 0),SATA硬盘被识别为硬盘驱动器1(driver 1)。这样,ubuntu系统就不想费事地去加载银盘驱动器1的驱动。如果SATA硬盘是你的主硬盘也许就不会这样了。我想上面的错误只有在你的主硬盘是PATA(并行ATA)的情况下才会发生。

解决方法:

为支持SATA硬盘重新编译一个适合的内核或者编辑你机器上的/etc/mkinitrd/modules文件,将下面的几行加入到结尾部分:

代码: 全选

ata_piix 
libata
sd_mod
scsi_mod


现在就可以建立一个新的初始化ramdisk(用内存虚拟硬盘)了:

代码: 全选

sudo mkinitrd -o /boot/initrd.img-<your version>.custom <your version> 


将<your version>换成你的内核版本号,你可以用uname -r命令获得这个版本号。

这些完成之后,编辑你的grub菜单项,加入你刚才定制的ramdisk:

代码: 全选

sudo nano /boot/grub/menu.list


将你的第一个入口获得你刚才做的ramdisk。搞定!

作为参考这里提供了我的fstab文件内容、menu.lst和modules文件:

代码: 全选

# /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



代码: 全选

# 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


代码: 全选

# /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


感谢zerokarmaleft给我的帮助使我能解决这个问题。把这个贴出来也是因为还有其他的朋友遇到了和我同样的问题。
头像
oneleaf
论坛管理员
帖子: 10218
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04
送出感谢: 7 次
接收感谢: 102 次

#3

帖子 oneleaf » 2005-08-02 9:20

当净其意如虚空,远离妄想及诸取,令心所向皆无碍
头像
millenniumdark
论坛版主
帖子: 4160
注册时间: 2005-07-02 14:41
系统: Ubuntu 14.04 (Kylin)
送出感谢: 43 次
接收感谢: 9 次
联系:

#4

帖子 millenniumdark » 2006-07-30 22:58

这个是5.04的
好像过时了
先放着
回复

回到 “软件和文档翻译”