免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 541 | 回复: 0
打印 上一主题 下一主题

将Ubuntu Linux系统装进移动硬盘的方法 [复制链接]

论坛徽章:
1
15-16赛季CBA联赛之北控
日期:2022-03-04 22:35:50
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-10 10:39 |只看该作者 |倒序浏览

作者: kit 出处:赛迪网 

阅读提示:在资金不充裕的情况下,没办法随时使用笔记本,有没有别的方法在公共计算机上安全自由的使用自己的程序和文件呢?把Ubuntu安装到自己移动硬盘上,就是一个不错的办法。
◆1、在Windows下从硬盘将 Ubuntu 装进移动硬盘(Grub for dos用0.4.3版本方有效)
在安装之前,要把硬盘引导文件和ubuntu-7.10-alternate-i386.iso放到某个盘符下(放移动硬盘下不行,grub之初检不到),7.10可以在ntfs下,不过以前的版本得在fat32下。后面和硬盘安装一样,只是装到移动硬盘上。在提示装Grub时最好不要装在win的mbr,可填上/dev/sdb(因为内部有SATA硬盘了)
◆2、将 GRUB4DOS 引导代码写入移动硬盘MBR
在已装好的ubuntu下,进入 bootlace.com 所在目录,假设移动硬盘为 /dev/sdb
运行命令
sudo ./bootlace.com --floppy /dev/sdb
◆3、配置 GRUB4DOS
在移动硬盘上找一个或新建一个 fat16/fat32/ext2/ext3 分区,将grldr 拷至其根目录, 并在同一目录下建立 menu.lst 文件,内容如下:
timeout 6
default 0
title Ubuntu, kernel 2.6.20-16-lowlatency
kernel /boot/vmlinuz-2.6.20-16-lowlatency
root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-lowlatency
quiet
title Ubuntu, kernel 2.6.20-16-lowlatency (recovery mode)
kernel /boot/vmlinuz-2.6.20-16-lowlatency
root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro single
initrd /boot/initrd.img-2.6.20-16-lowlatency
title Ubuntu, kernel 2.6.20-16-generic
kernel /boot/vmlinuz-2.6.20-16-generic
root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
kernel /boot/vmlinuz-2.6.20-16-generic
root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro single
initrd /boot/initrd.img-2.6.20-16-generic
title Ubuntu, kernel 2.6.20-15-lowlatency
kernel /boot/vmlinuz-2.6.20-15-lowlatency
root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro quiet splash
initrd /boot/initrd.img-2.6.20-15-lowlatency
quiet
title Ubuntu, kernel 2.6.20-15-lowlatency (recovery mode)
kernel /boot/vmlinuz-2.6.20-15-lowlatency
root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro single
initrd /boot/initrd.img-2.6.20-15-lowlatency
title Ubuntu, kernel 2.6.20-15-generic
kernel /boot/vmlinuz-2.6.20-15-generic
root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
kernel /boot/vmlinuz-2.6.20-15-generic
root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro single
initrd /boot/initrd.img-2.6.20-15-generic
title Ubuntu, memtest86+
kernel /boot/memtest86+.bin
quiet
### END DEBIAN AUTOMAGIC KERNELS LIST
其中,“177430b6-2e85-4674-88c1-029d51aeca13”需换成根分区"/" 的UUID。
查看各分区UUID的命令:
ls -l /dev/disk/by-uuid
或者直接到通过装好的ubuntu 看移动硬盘中根分区下/boot/grub/menu.list中去看它写入的uuid是多少,复制过来就行
◆4、硬件自动检测
将ptptptptpt附件中 S03xconfig.sh 复制到 /etc/rc2.d/ ,并修改其权限使“允许作为可执行文件执行” —— 这个用来配置 X 。至此,移动硬盘系统已经可以在不同机子上运行了。
sudo cp xxxxx/S03xconfig.sh /etc/rc2.d/S03xconfig.sh;xxxxx省略,按实际路径做
sudo chmod 755 /etc/rc2.d/S03xconfig.sh
再安装两个软件以增强硬件检测能力:启动移动硬盘系统,设置好源,连上网络,运行命令代码:
apt-get update
apt-get install discover1 xresprobe
搞定。
◆5、如果不支持USB-HDD启动,可以将移动硬盘中装好的/boot目录,上述menu.list文件放到机器C:\下,并在装好Grub4dos,改好boot.ini启动选改好的项即可。
◆6、在将移动硬盘插到别的机器上时要设重新设一下xserver
sudo dpkg-reconfigure xserver-xorg
在从HDD启动时,应该要在kernel和initrd后添加盘
如我的是:
kernel (hd0,7)/boot/vmlinuz-2.6.20-16-lowlatency root=UUID=177430b6-2e85-4674-88c1-029d51aeca13 ro quiet splash
initrd (hd0,7)/boot/initrd.img-2.6.20-16-lowlatency。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/31/showart_524985.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP