http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/7.bmp" alt="" />
我們可以在/etc/fstab 設(shè)置開(kāi)啟掛載,不過(guò)如果在/etc/fstab 定義了掛載信息可是實(shí)際并不存在此分區(qū),開(kāi)機(jī)進(jìn)行分區(qū)掛載時(shí)就會(huì)產(chǎn)生錯(cuò)誤,導(dǎo)致我們不能進(jìn)入操作系統(tǒng),如下圖
http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/8.bmp" alt="" />
根源在于 /etc/fstab中/dev/sda6分區(qū)并不存在,只需要將這行去掉即可
LABEL=/ / ext3 defaults 1 1
LABEL=/home /home ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda5 swap swap defaults 0 0
/dev/sda6 /mnt/sda6 ext3 defaults 1 2
可是/etc/fstab 是只讀文件,正確情況下不能修改,所以需要些特殊操作
步驟1.設(shè)置 menu.lst 開(kāi)機(jī)信息。指定為單用戶
http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/9.bmp" alt="" />
步驟2:設(shè)置重新掛載,解決只讀問(wèn)題
http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/10.bmp" alt="" />
步驟3:修改文件并重新啟動(dòng)即可
http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/11.bmp" alt="" />
Ubantu 光盤(pán)可以不需要安裝而進(jìn)行使用,應(yīng)用此特點(diǎn),我們可以將修需要修改的文件所在分區(qū)掛載到這個(gè)系統(tǒng)下進(jìn)行修改。 (我是在虛擬機(jī)實(shí)驗(yàn),PC 效果是一樣的)
http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/12.bmp" alt="" />
步驟1:設(shè)置 BIOS 進(jìn)行開(kāi)啟光盤(pán)啟動(dòng)
http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/13.bmp" alt="" />
http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/14.bmp" alt="" />
添加鏡像文件,并設(shè)置通電時(shí)進(jìn)行連接(PC 下不需要,這是模擬光驅(qū))
http://wiki.jikexueyuan.com/project/learn-linux-step-by-step/images/15.bmp" alt="" />
步驟2: 試用 Ubantu
步驟3: 掛載與修改問(wèn)題文件
root@ubuntu:~# fdisk -l
Device Boot Start End Blocks Id System
/dev/sda1 * 63 208844 104391 83 Linux
/dev/sda2 208845 20691719 10241437+ 83 Linux
/dev/sda3 20691720 30925124 5116702+ 83 Linux
/dev/sda4 30925125 41929649 5502262+ 5 Extended
/dev/sda5 30925188 32965379 1020096 82 Linux swap / Solaris
root@ubuntu:~# mount /dev/sda2 /mnt
root@ubuntu:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
…….
/dev/sda2 9920624 4275888 5132668 46% /mnt
root@ubuntu:~# vim /mnt/etc/fstab
root@ubuntu:~# umount /dev/sda2