重新安装OpenBSD操作系统过程中保留个人数据的探索

OpenBSD的安装、升级、更新等日常问题。

版主: chenjun天地乾坤

回复
f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

重新安装OpenBSD操作系统过程中保留个人数据的探索

帖子 f5b » 2012-02-18 20:02

重新安装OpenBSD操作系统过程中保留个人数据的探索

Welcome to the OpenBSD/i386 5.0 installation program.
(I)nstall, (U)pgrade or (S)hell? i

And with that, we reach our first question. You have the three options shown:

Install: load OpenBSD onto the system, overwriting whatever may have been there. Note that it is possible to leave some partitions untouched in this process, such as a /home, but otherwise,

assume everything else is overwritten.

以下仅针对安装过程中选择(I)nstall步骤

一、最重要的一步,进入旧系统查看OpenBSD分区情况,如disklabel wd0,记录到纸上,打印出来最安全。
二、重装过程中,在disklabel步骤
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a]
此时必须输入E或者C(E工作量少),一旦选择A,接下来的步骤将会格式化整个OpenBSD slice,所有数据都丢失。
后面的过程中,以保留/home分区的数据为例(其他分区数据也可以用这种方法保留),必要条件有两个
1. 必须保证原来属于/home的空间没有被分配到其他分区中
2. 不能mount point /home,可在安装成功reboot系统后在/etc/fstab中添加回来
具体一些,看以下示意
> a n (假设n分区将分给/home)
offset: [103185472] Enter (确定/home分区的start开始处与重装之前一致)
size: [208985472] Enter (确定/home分区的总大小与重装之前一致)
mount point: [none] Enter (不能输入任何信息,若输入/home,则该分区数据都会被格式化)
>

BTW,bsd.rd的installer应该做出改进,让用户重装系统时保留数据更便捷安全。



一下内容发送给了misc@openbsd.org
when re-install how to make "leave some partitions untouched" simple

http://www.openbsd.org/faq/faq4.html
says

Install: load OpenBSD onto the system, overwriting whatever may have been there.
Note that it is possible to leave some partitions untouched in this process, such as a /home,
but otherwise, assume everything else is overwritten.

NOTE for re-installers: The new installer will not clear your old disklabel if you chose "(C)ustom Layout",
but you will need to re-specify each mount point using the 'm' option in disklabel(8).

when re-install OpenBSD, if we want to keep original /home's data, are following steps the key point?
1) let the space belong to original /home partition untouched.
2) not set /home mount point, add /home to /etc/fstab after install

If I have more than one partitions to leave untouched, to save more steps & time,
I choose "(E)dit auto layout" rather than "(C)ustom Layout",delete some partitions, add some partitions and leave mount point untouched.
the steps are not simple and error-prone, should we improve the installer ?

before the step " Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] "
we add some step, for example:

Keep some partitions untouched? [yes] Enter
Partitions' mount point? ('?' for list) [/home] ## Note that multiple mount point can be listed, separated by spaces.

...

头像
acheng
锌 Zn
帖子: 581
注册时间: 2011-07-07 21:52

回复: 重新安装OpenBSD操作系统过程中保留个人数据的探索

帖子 acheng » 2012-02-20 11:29

选择E我觉得不安全,在系统自动分区时有可能其他的分区会和你要保留的分区有重叠。最好选择C,自定义disklabel。

不熟悉的disklabel的朋友建议在重装前备份要保留的数据,这样最安全

头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

回复: 重新安装OpenBSD操作系统过程中保留个人数据的探索

帖子 leo » 2012-02-20 12:07

方法差不多,我的是这样:
http://www.gobsd.org/blog.php?b=9

头像
unreal
银 Ag
帖子: 1080
注册时间: 2010-06-07 18:52

回复: 重新安装OpenBSD操作系统过程中保留个人数据的探索

帖子 unreal » 2012-03-14 21:14

这事儿偶好像已经探索过了。分区打印出来确实好,我一般是用手机拍个照。install脚本必须改进~
勤能補拙 Just do it now!

f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

回复: 重新安装OpenBSD操作系统过程中保留个人数据的探索

帖子 f5b » 2012-04-07 18:33

补充,今天做了重装的试验,重点在于安装文件来自/home分区

重装之前,把安装文件(bsd, base51.tgz等)下载到/home分区 某目录下
把新版bsd.rd放到/bsd.rd

reboot

启动菜单中输入bsd.rd

如前所述
(E)dit auto layout

d k (假设k分区是原来的/home)

a k (此时必须add回 /home所在分区k,否则后面选择disk安装源时没有k分区可用)

mount point: [none] Enter (不能输入任何信息,若输入/home,则该分区数据都会被格式化)

碧落星河
铁 Fe
帖子: 61
注册时间: 2011-08-03 18:39

回复: 重新安装OpenBSD操作系统过程中保留个人数据的探索

帖子 碧落星河 » 2012-04-08 12:43

f5b 写了:补充,今天做了重装的试验,重点在于安装文件来自/home分区

重装之前,把安装文件(bsd, base51.tgz等)下载到/home分区 某目录下
把新版bsd.rd放到/bsd.rd

reboot

启动菜单中输入bsd.rd

如前所述
(E)dit auto layout

d k (假设k分区是原来的/home)

a k (此时必须add回 /home所在分区k,否则后面选择disk安装源时没有k分区可用)

mount point: [none] Enter (不能输入任何信息,若输入/home,则该分区数据都会被格式化)
我没有试过,但有点我不明白,为什么要把K分区,也就是原先的home分区删了再建?留着不分配挂载点不可以吗?

f5b
锆 Zr
帖子: 643
注册时间: 2011-10-22 20:43

回复: 重新安装OpenBSD操作系统过程中保留个人数据的探索

帖子 f5b » 2012-04-08 17:38

碧落星河 写了:我没有试过,但有点我不明白,为什么要把K分区,也就是原先的home分区删了再建?留着不分配挂载点不可以吗?
忘记描述具体前提

第一次安装用(A)uto layout,
第二次重新安装系统,为了快速和干净,用(I)nstall模式
分区那里选(E)dit auto layout, 由于此时(E)dit auto layout已经有/home的挂载点,必须d k。马上a k分区回去,目的是为了后面选择安装源时候能够mount /home原来的分区,读取到里面的安装文件
如果安装源不在/home分区,在其他地方,a k就不是必须的步骤了。

因为安装操作系统之后第一次进入系统,可以做类似
disklabel -E /dev/wd0
的操作,添加k分区(a k)

碧落星河
铁 Fe
帖子: 61
注册时间: 2011-08-03 18:39

回复: 重新安装OpenBSD操作系统过程中保留个人数据的探索

帖子 碧落星河 » 2012-04-08 20:01

我重装过几次系统,没有特意保留数据,但我记得我都是选的C,也就是自定义分区,从来没选过A和E。
选C时,以前的分区都存在,只是没有了挂载点,要重新设定挂载点才行。下次再重装时留着home的那个分区,不设定挂载点,看系统装完后再挂载成home后里面的资料还在不在。

回复

在线用户

正浏览此版面之用户: 没有注册用户 和 26 访客