ubuntu PE (8.10)
- ptptptptptpt
- 帖子: 3711
- 注册时间: 2006-09-19 18:16
Re: ubuntu PE (8.10)
还有 swap 、 /home 的啊
还有一个 proc 什么的
除此之外也就没啥要添加的了吧??
还有一个 proc 什么的
除此之外也就没啥要添加的了吧??
-
- 帖子: 3681
- 注册时间: 2008-05-03 23:42
Re: ubuntu PE (8.10)
cdrom 不知道不写行不行,应该是可以的。
-
- 帖子: 3681
- 注册时间: 2008-05-03 23:42
Re: ubuntu PE (8.10)
有一种做法就是在 fstab 里不写什么东西,然后在 rc.local 里写
比如我使用 pagefile.sys 做 swap 是这样写
mount /dev/sda1 /win/c
mkswap -c /win/c/pagefile.sys
swapon /win/c/pagefile.sys
挂载选项就自动处理了
不知道挂 /home 这些目录行不行。改天做一个最复杂的分区方案试一试。如果可以就只要写 rc.local
mount /dev/disk/by-uuid/... /home
...
不要管挂载选项了
比如我使用 pagefile.sys 做 swap 是这样写
mount /dev/sda1 /win/c
mkswap -c /win/c/pagefile.sys
swapon /win/c/pagefile.sys
挂载选项就自动处理了
不知道挂 /home 这些目录行不行。改天做一个最复杂的分区方案试一试。如果可以就只要写 rc.local
mount /dev/disk/by-uuid/... /home
...
不要管挂载选项了
-
- 帖子: 3681
- 注册时间: 2008-05-03 23:42
Re: ubuntu PE (8.10)
还有我刚刚听说用 cp 或者其他的恢复方法创造的 lost+found 其实在真正需要使用的时候是不能工作的
应该删掉这样的 lost+found
cd 到每一个 ext? 分区的根
用命令
mklost+found
我估计 ghost 版 ubuntu 也有这个问题,需要重建 lost+found
应该删掉这样的 lost+found
cd 到每一个 ext? 分区的根
用命令
mklost+found
我估计 ghost 版 ubuntu 也有这个问题,需要重建 lost+found
- ptptptptptpt
- 帖子: 3711
- 注册时间: 2006-09-19 18:16
- adagio
- 论坛版主
- 帖子: 22110
- 注册时间: 2008-02-17 23:47
- 来自: 美丽富饶的那啥星球
Re: ubuntu PE (8.10)
不错啊,启动比那个8.04版的快了不少!
不过怎么桌面上没有安装程序了?就像那个8.04PE那样挺好么
倒是看到有个/rofs,看起来很像根目录,500多M,是不是这个目录整个cp到某个分区就可以启动的?

不过怎么桌面上没有安装程序了?就像那个8.04PE那样挺好么
倒是看到有个/rofs,看起来很像根目录,500多M,是不是这个目录整个cp到某个分区就可以启动的?
明天就换大三八!
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……
---------------------------------------------------------------------------------
★ [图片版]新手当自强(续)FAQ
★ [新手进阶]挂载、fstab、调整linux分区
★ [图片版]E17桌面环境配置手把手
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……
---------------------------------------------------------------------------------
★ [图片版]新手当自强(续)FAQ
★ [新手进阶]挂载、fstab、调整linux分区
★ [图片版]E17桌面环境配置手把手
- ptptptptptpt
- 帖子: 3711
- 注册时间: 2006-09-19 18:16
Re: ubuntu PE (8.10)
这个跟 8.04 那个定位不一样,所以没有安装程序
可以用48楼的脚本把 squashfs 恢复到硬盘分区
可以用48楼的脚本把 squashfs 恢复到硬盘分区

-
- 帖子: 3681
- 注册时间: 2008-05-03 23:42
Re: ubuntu PE (8.10)
我在写一个备份和恢复 squashfs 的小脚本,写了备份的部分。恢复的部分我需要用到 blkid,发现一个问题,从 squashfs 启动后用 blkid 查看残留着原来的分区信息。又回头看了你的这个东西,也有这个问题。我可以看到你原来的直到 sda10 的信息。可是我只有 sda7。帮忙研究一下 
脚本目前完成情况:

脚本目前完成情况:
代码: 全选
#!/bin/sh
workingdir=`uuidgen`
resultdir=`uuidgen`
mypath=$0
myname=`basename "$mypath"`
packagecheck(){
dpkg -s squashfs-tools > /dev/null 2>&1 || { echo "squashfs-tools is required to run this program."; exit 1; }
}
rebuildtree(){
mkdir /$workingdir
mount --bind / /$workingdir
mount --bind /boot /$workingdir/boot
mount --bind /home /$workingdir/home
mount --bind /tmp /$workingdir/tmp
mount --bind /usr /$workingdir/usr
mount --bind /var /$workingdir/var
mount --bind /srv /$workingdir/srv
mount --bind /opt /$workingdir/opt
mount --bind /usr/local /$workingdir/usr/local
}
destroytree(){
umount /$workingdir/usr/local
umount /$workingdir/opt
umount /$workingdir/srv
umount /$workingdir/var
umount /$workingdir/usr
umount /$workingdir/tmp
umount /$workingdir/home
umount /$workingdir/boot
umount /$workingdir
rmdir /$workingdir
}
checkdir(){
[ "${1#/}" = "$1" ] && { echo "You must specify the absolute path"; exit 1; }
[ -d "$*" ] || { echo "$* does not exist, or is not a directory"; exit 1; }
}
dobackup(){
packagecheck
echo "You are about to backup your system. It is recommended that you quit all open applications now. Continue?(y/n)"
read yn
[ "$yn" != "y" ] && exit 1
echo "Specify a directory(absolute path) to save the backup. If you don't specify, /$resultdir will be used"
read backupdir
# 脱引号
[ "${backupdir#'}" != "$backupdir" ] && [ "${backupdir%'}" != "$backupdir" ] && { backupdir="${backupdir#'}"; backupdir="${backupdir%'}"; }
[ "$backupdir" != "" ] && { checkdir $backupdir; resultdir="${backupdir#/}"; }
ls "/$resultdir/backup.squashfs" > /dev/null 2>&1 && { echo "Error: /$resultdir/backup.squashfs already exists"; exit 1; }
mkdir -p "/$resultdir"
rebuildtree
mksquashfs /$workingdir "/$resultdir/backup.squashfs" -e "$myname" "$resultdir" "$workingdir" boot/grub etc/fstab lost+found boot/lost+found home/lost+found tmp/lost+found usr/lost+found var/lost+found srv/lost+found opt/lost+found usr/local/lost+found
destroytree
mksquashfs "$mypath" "/$resultdir/backup.squashfs"
cp /boot/initrd.img-`uname -r` "/$resultdir/initrd.img"
cp /boot/vmlinuz-`uname -r` "/$resultdir/vmlinuz"
echo "Your backup is ready in /$resultdir :)"
}
dorestore(){
echo under construction
}
[ "$(whoami)" != root ] && { echo "Admin rights are required to run this program."; exit 1; }
[ "$*" = -b ] && { dobackup; exit 0; }
[ "$*" = -r ] && { dorestore; exit 0; }
echo "usage"
exit 1
-
- 帖子: 3681
- 注册时间: 2008-05-03 23:42
Re: ubuntu PE (8.10)
找到了。
/etc/blkid.tab 也应列入排除。
看来以前的教程都没研究到这个细节。用 tar 来备份一定也有这个问题。Ghost 应该也会,只是我做 ghost 的时候只有 sda1,自然被正确的 sda1 覆盖了,如果当时有 sda10... 一定也会残留。
/etc/blkid.tab 也应列入排除。
看来以前的教程都没研究到这个细节。用 tar 来备份一定也有这个问题。Ghost 应该也会,只是我做 ghost 的时候只有 sda1,自然被正确的 sda1 覆盖了,如果当时有 sda10... 一定也会残留。
-
- 帖子: 3681
- 注册时间: 2008-05-03 23:42
Re: ubuntu PE (8.10)
还有 /etc/mtab 这个文件会在启动时重建,所以并没关系。但是以 squashfs 启动时似乎并不会重建,只在 /rofs/etc/mtab 的基础上添加些东西成为内存里的 /etc/mtab,所以在运行 squashfs 的时候看 mount 很奇怪。我注意到你的 /rofs/etc/mtab 是空的,是不是你已经注意到这个问题?
- ptptptptptpt
- 帖子: 3711
- 注册时间: 2006-09-19 18:16
Re: ubuntu PE (8.10)
/rofs/etc/mtab 注意到了。而/etc/blkid.tab 之前不知道。这也是我说“做可启动映像比较麻烦”的原因。你得注意很多细节。
或许 /etc/blkid.tab 跟 /etc/mtab类似,正常安装的系统在重启时会重建,而 live 系统不会。
官方 live cd 应该是用 debootstrap + chroot 做的,没有这些问题。但这种方法在某些定制细节上不太方便。
或许 /etc/blkid.tab 跟 /etc/mtab类似,正常安装的系统在重启时会重建,而 live 系统不会。
官方 live cd 应该是用 debootstrap + chroot 做的,没有这些问题。但这种方法在某些定制细节上不太方便。
- ptptptptptpt
- 帖子: 3711
- 注册时间: 2006-09-19 18:16
-
- 帖子: 3681
- 注册时间: 2008-05-03 23:42
Re: ubuntu PE (8.10)
和 mtab 不同, blkid.tab 不会重建,只会修改。如果原来的 blkid.tab 里包含 sda10 的信息,而系统里并没有 sda10,这个垃圾会一直存在下去。所以不论你用何种方法备份,即使你另起一个 livecd 来,这个问题都会存在。总应该在备份时排除。
所以 69 楼我说了,经典的 tar 方法同样存在这样的问题。这个问题只在原来的分区较多而恢复后的分区较少的时候才浮现出来。
所以 69 楼我说了,经典的 tar 方法同样存在这样的问题。这个问题只在原来的分区较多而恢复后的分区较少的时候才浮现出来。
-
- 帖子: 3681
- 注册时间: 2008-05-03 23:42
Re: ubuntu PE (8.10)
如果还有什么已知的细节,请不吝指教。/rofs/etc/mtab 注意到了。而/etc/blkid.tab 之前不知道。这也是我说“做可启动映像比较麻烦”的原因。你得注意很多细节。
- ptptptptptpt
- 帖子: 3711
- 注册时间: 2006-09-19 18:16
Re: ubuntu PE (8.10)
我知道的肯定会说的。我担心的是所不知道的,就像 /etc/blkid.tab ,可能需要一些时间慢慢发现。