制作可移动的linux系统(Ubuntu)
制作可移动的linux系统(Ubuntu)
1、光盘启动,安装复制到移动硬盘,将grub安装到dev/sda。
2、复制完后重启,光盘启动,安装启动界面输入rescue,进入急救模式,选择挂载分区时,选择系统所在硬盘和分区。
3、ctrl-Alt-F2,打开新窗口。
CODE:mount -tproc proc /target/proc
chroot /target
su
4、nano /etc/mkinitramfs/modules
加入:ehci-hcd
CODE:usb-storage
scsi_mod
sd_mod
5、nano /etc/mkinitramfs/initramfs.conf
在前面加上:WAIT=12
6、mkinitramfs -o /boot/initrd.img-2.6-…… /lib/modules/2.6……
7、nano /boot/grub/menu.lst修改menu.lst:root (?.?)改为系统所在分区。
8、重起,进入BIOS,选择usb-hdd启动;没有这项的话,在disk sequence里调整磁盘序列,
将usb硬盘调到本地硬盘前,让电脑从usb启动;如果rp太差,主板的disk sequence里没有
认出移动硬盘,只有制作grub软盘,然后用虚拟软盘启动。成功从移动硬盘启动后,继续安
装过程,直到完成,进入系统。
9、经过数次测试,系统的移动性能非常好,在不同电脑上正常使用,只是开始不能启动
xwindows,使用命令:
CODE:sudo dpkg-reconfigure -phigh xserver-xorg
自动配置显卡,nv和ati显卡都能自动识别,正常进入xwindows。
10、启动时自动配置xorg.conf
在/etc/rc2.d下增加一个可执行脚本S03xconfig.sh
内容如下:
#!/bin/bash
#
# /etc/rc2.d/S03xconfig
#
reconfigx(){
echo "Reconfiguring xserver-xorg ... "
dpkg-reconfigure -fnoninteractive --no-reload xserver-xorg
}
if [ -e /etc/X11/xconfig.log ] ;then
lspci > /etc/X11/xconfig.tmp
diff /etc/X11/xconfig.tmp /etc/X11/xconfig.log > /etc/X11/different
if [ -s /etc/X11/different ] ;then
reconfigx
# delete screen config
lspci > /etc/X11/xconfig.log
fi
else
lspci > /etc/X11/xconfig.log
reconfigx
fi
exit 0
相关文档:
PHP在运行的时候,直接kill掉,有肯能造成数据的丢失。幸好php模块,有针对signal的处理。
处理方式,首先检查有没有安装 PCNTL 模块
然后可以在一个包含文件中,添加以下代码
global $exitFlag;
$exitFlag = false;
// 增加linux信号量处理
if (DIRECTORY_SEPARATOR != '\\') {
pcntl_signal(SI ......
1. Download all packet and patchs Done
2. To be involved in the mail list
3. Check Host Requirements Done
还学习了 cut 显示某行的指定field ,head 显示前几行,readlin ......
Linux下getch()和getche()
I would recommend never mixing input techniques in a program. Don't mix fgets() or scanf() with getchar(). Don't mix any standerd C library input function with a non-standard function that bypasses the C stream mechanism, be that getch(), getche(), bioskey(), or anything el ......
【转】Linux虚拟机下如何共享ADSL拨号上网
2010-01-20 11:55
今天在vmware上装了一个Red Hat Enterprise Linux 5,装好之后,我想在虚拟机上共享我的adsl拨号上网,设置过程如下:
1. 先在adsl连接属性上允许共享Internet连接:
2.这样做后会弹出一个对话框,告诉你会把本地连接的ip地 ......