2010年3月30日 星期二

ubuntu BusyBox problem

environment: ubuntu 9.10 with grub2 , ext4 filesystem

昨天用了shutdown讓ubuntu自動關機後,
今天從grub選單選了ubuntu要進入後,
出現了類似以下的訊息
Gave up waiting for root device. Common problems:

-Boot args (cat /proc/cmdline)
-Check rootdelay= (did the system wait long enough?)
-Check root= (did the system wait for the right device?)
-Missing modules (cat /proc/modules; ls /dev)
Alert .... /dev/disk/by-uuid/34e5c1 ... does not exist ...

似乎是因為root device找不到 所以進入了busybox
root drive is not available or not recognized while ubuntu is loading

重新用reboot重新啟動到grub的選單裡
在選單上按e進入修改
發現我原先是類似

linux /boot/vmlinuz-2.6.31-16-generic root=UUID=xxxxxxxxxxxxxxxx ro quiet splash

網路上的解法是把UUID的表示法,改成/dev/sdaX之類的表示法
(也許是UUID找不到?!)
其中 /dev/sdaX 是你安裝ubuntu的位置
p.s 如果不知道的話,可以用ubuntu live CD 進入 ubuntu裡,
在terminal打 sudo fdisk -l

假設我linux是安裝在 /dev/sda4
則這裡就要改成

linux /boot/vmlinuz-2.6.31-16-generic root=/dev/sda4 ro quiet splash


再按ctrl+x重新啟動
就可進入了。

正確進入後,要記得打上
sudo update-grub
重新更新grub

以上的解法是參考http://computergyan.wordpress.com/2009/12/31/solving-the-busybox-black-screen-problem-in-grub2ubuntu9-10/

但實際上,我一開始不是用這個解決的.....
一開始我很擔心我的資料是不是都不見了.....
所以用liveCD打開ubuntu後,試著mount -t ext4 /dev/sda4 到某處
結果資料都還在!!!那就表示只是grub無法正確的找到root device來mount

我的方法是: (參考自這裡)
1) use liveCD to enter ubuntu
2) open terminal
3) sudo mount /dev/sda4 /mnt
(將自己安裝的系統掛載到 /mnt,如果系統的 /boot 在另一個硬碟,請一併掛到 /mnt 下)
4) sudo mount –bind /dev /mnt/dev (掛載設備)
5) sudo chroot /mnt (以root的身份進到舊系統裡)
6) nano /etc/default/grub
(如果要改的話,就改這個檔案
ex: GRUB_CMDLINE_LINUX="rootdelay=90" <=加上rootdelay參數 #GRUB_HIDDEN_TIMEOUT_QUIET=true ) 7) update-grub (更新grub) 這步可能會有一些error(ex:Cannot find list of partitions!),這是由於你的雙系統的關係~ 先ignore 等下次進入ubuntu後,再執行一次update-grub後,就會重新找到windows的記錄!
8) grub-install /dev/sda 這步說明上有說要做,但因為我是以win7的開機程式為主,所以這裡grub就不寫到MBR (當初安裝時也是直接安裝在/dev/sda4裡),我就不用執行這個動作!!
9) exit (離開舊系統環境)
10) sudo umount /mnt/dev
sudo umount /mnt (依續解除剛剛的mount)
11) 重新啟動電腦~就可以進入了!!!
12) 要記得正常進入ubuntu後,要update-grub

結果在grub選單裡,按e進入查看...
發現修改後的東西就是前一個方法的內容....(把UUID的部分改成root=/dev/sda4)
所以我就在猜第一個方法可能有用.....


這裡有一篇把initramfs和BusyBox的問題分析的滿好的
可以參考一下~雖然我完全沒有採納他所講的XD但可以了解busybox的訊息之類的。
有助於分析問題。

2010年3月29日 星期一

flex builder in ubuntu

My environment: ubuntu 9.10

reference:  adobe's release notes

1. install java jre if you don't have it
sudo apt-get install sun-java6-jre
p.s sun jre 1.5 above is enough
2. install eclipse (eclipse3.3 above)
sudo apt-get install eclipse
3. download eclipse plugin binary from adobe
http://labs.adobe.com/downloads/flexbuilder_linux.html

4. execute the downloaded bin
ex: sh xxxx.bin

2010年3月25日 星期四

svn

https://help.ubuntu.com/community/Subversion

安裝:
sudo apt-get install subversion libapache2-svn apache2
建立svn倉庫

sudo mkdir /home/svn
cd /home/svn
sudo mkdir myproject
sudo svnadmin create /home/svn/myproject
sudo chown -R www-data:www-data /home/svn
sudo chmod -R g+rws myproject

1)從apache看

sudo gedit /etc/apache2/mods-available/dav_svn.conf


加入

<Location /svn>
     DAV svn
     SVNParentPath /home/svn
     SVNListParentPath On
     AuthType Basic
     AuthName "Subversion Repository"
     AuthUserFile /etc/subversion/passwd
     <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
     </LimitExcept>
  </Location>


restart apache
sudo /etc/init.d/apache2 restart
加passwd

sudo htpasswd -c /etc/subversion/passwd user_name
cat /etc/subversion/passwd  (確認用)

access
svn co http://localhost/svn/myproject myproject --username user_name

2010年3月24日 星期三

自動掛載windows硬碟

1. 先找出windows硬碟代表的UIUD

sudo blkid

畫面大概像這樣

/dev/sda5: UUID="74589xxxxxxxx" LABEL="DATA" TYPE="ntfs"

2. 修改 /etc/fstab ,以便開機時能自動掛載硬碟分割

sudo gedit /etc/fstab
加入
# mount selected partition
UUID=74589xxxxxxxx /media/disk ntfs defaults 0 0


3. 建立掛載點(如果原本不存在)

sudo mkdir /media/disk


4. 檢查是否有掛載了

df

5. 測試fstab檔是否有錯,沒錯則mount

sudo mount -a



ps. 卸載方法

sudo umount /dev/sda5