2007-05-24

 

初用Ubuntu 7.04 -- 修改分区,添加Windows

想要做多系统,追回一个windows2003。
先是为新系统分配一个磁盘分区。原来的分区为swap, /, /XXX,共三个,将最后一个分区一分为二,变为一个ntfs分区和一个fat32分区,重启系统后,使用ghost,将以前的windows2003备份恢复到新的ntfs分区中。
原先只有一个ubuntu系统,grub被安装在磁盘的mbr中,重启后,进入ubuntu的过程中,提示出错,原因是最后一个分区被修改,导致挂载失败。系统没有直接进入图形的登录界面,而是以root身分,运行了一个shell。令人意想不到的是,输入"reboot",竟然进入了图形登录界面,输入用户名密码,进入了gnome桌面,这对于没有多少命令记得的我来说,是最好不过了。

进入系统后,为了能正常启动ubuntu和windows2003,需要修改/etc/fstab和/boot/grub/menu.lst这两个文件。
fstab保存了系统自动挂载项目,打开后,将/dev/sda3注释掉(即原来的最后一个分区),再追加新的两个分区的挂载项。

/dev/sda3 /ntfs ntfs noauto,codepage=936,iocharset=cp936 0 0
/dev/sda4 /mos vfat defaults,codepage=936,iocharset=cp936 0 0

这也是从网上参考的,没去查手册,/dev/sda3是第一个磁盘的第3个分区,现在装的是windows2003,这不需要挂载,所以加了noauto选项,否则进入到Gnome桌面后,会自动挂载,并在桌面上出现磁盘图标,不过加了这个选项后,在文件浏览器的位置面板上,还是能看到,但双击时,提示非root不能挂载。

/dev/sda4是我分出来,作为两个系统共同使用的数据存储分区,使用了两个系统都能稳定可靠操作的fat32格式。使用目前的参数,却有一个问题,这个分区对于普通用户来说,是只读的,我只好用sudo来操作写数据,还勉强可以接受,就此也没再去细究。另外还有一个问题是,在ubuntu下将中文文件名的文件复制过去,到windows2003下,变成了乱码,估计也是参数不正确的原因,一般来说,不大会使用中文文件名,所以也就懒得管了。

menu.lst这个文件的修改很顺利,因为它本身就有启动win98/2000的sample,复制过来,去掉注释即可,或再改一下title,启动时菜单等待时间等。。。

title Windows 2003
root (hd0,2)
makeactive
chainloader +1

另外几个选项,含有详细的说明
## 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'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

最后一项,如果要默认显示菜单,我估计可能是:showmenu吧,可以试试,或是到网上确认一下。

Labels:


Comments: Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]