当在已经存在 Ubuntu 安装的分区上重新安装 Ubuntu,并且不选择格式化该分区时,安装程序会在开始安装之前显示一条警告消息:
分配给 / 的 /dev/sda5 上的文件系统尚未标记为要格式化。已在任何定义的挂载点下存在的包含系统文件(/etc、/lib、/usr、/var 等)的目录将在安装过程中被删除。
请确保在安装之前已备份所有关键数据。
此处的“系统目录”列表似乎不完整。此外,我期望 /home 是系统目录,但根据经验,我知道 /home 不会被删除。
安装过程中将删除的目录的完整列表是什么?
答案1
我没能找到硬编码列表无处不在源代码。文档说分区由 di(debian 安装程序)代码处理,以避免重复和维护工作。但我无法在相关包或 Debian 文档。
幸运的是/var/log/syslog
,分别/var/log/installer/syslog
安装后,包含关于无处不在和安装过程的有用信息。以下是从我的虚拟机上的 12.04 安装中摘录的:
May 27 21:20:12 ubuntu ubiquity[8109]: switched to page partman
May 27 21:20:35 ubiquity[8109]: last message repeated 5 times
May 27 21:20:35 ubuntu kernel: [ 598.116238] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
May 27 21:20:35 ubuntu ubiquity: umount: /tmp/tmp.5jn9BTMDwz: device is busy.
May 27 21:20:35 ubuntu ubiquity: (In some cases useful info about processes that use
May 27 21:20:35 ubuntu ubiquity: the device is found by lsof(8) or fuser(1))
May 27 21:20:35 ubuntu ubiquity:
May 27 21:20:37 ubuntu ubiquity[8109]: debconffilter_done: ubi-partman (current: ubi-partman)
May 27 21:20:37 ubuntu ubiquity[8109]: Step_before = stepPartAdvanced
May 27 21:20:37 ubuntu clock-setup: Sun May 27 21:20:37 UTC 2012
May 27 21:20:37 ubuntu clock-setup: rdate: adjust local clock by -0.063701 seconds
May 27 21:20:40 ubuntu ubiquity[8109]: switched to page timezone
May 27 21:20:42 ubuntu kernel: [ 605.076359] Adding 784380k swap on /dev/sda5. Priority:-1 extents:1 across:784380k
May 27 21:20:42 ubuntu kernel: [ 605.225583] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
May 27 21:20:51 ubuntu ubiquity: not installable:
May 27 21:20:51 ubuntu ubiquity: version mismatch:
May 27 21:20:51 ubuntu clear_partitions: Considering /,/dev/sda1.
May 27 21:20:51 ubuntu kernel: [ 614.038996] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
May 27 21:20:51 ubuntu clear_partitions: Removing bin from / (/dev/sda1).
May 27 21:20:51 ubuntu clear_partitions: Removing dev from / (/dev/sda1).
May 27 21:20:51 ubuntu clear_partitions: Removing etc from / (/dev/sda1).
May 27 21:20:52 ubuntu clear_partitions: Removing lib from / (/dev/sda1).
May 27 21:20:52 ubuntu clear_partitions: Removing lib64 from / (/dev/sda1).
May 27 21:20:52 ubuntu clear_partitions: Removing proc from / (/dev/sda1).
May 27 21:20:52 ubuntu clear_partitions: Removing sbin from / (/dev/sda1).
May 27 21:20:52 ubuntu clear_partitions: Removing sys from / (/dev/sda1).
May 27 21:20:52 ubuntu clear_partitions: Removing usr/bin from / (/dev/sda1).
May 27 21:20:52 ubuntu clear_partitions: Removing usr/games from / (/dev/sda1).
May 27 21:20:52 ubuntu clear_partitions: Removing usr/include from / (/dev/sda1).
May 27 21:20:53 ubuntu clear_partitions: Removing usr/lib from / (/dev/sda1).
May 27 21:20:53 ubuntu clear_partitions: Removing usr/not-formatted from / (/dev/sda1).
May 27 21:20:53 ubuntu clear_partitions: Removing usr/sbin from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing usr/share from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/backups from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/cache from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/crash from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/games from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/lib from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/lock from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/log from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/mail from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/not-formatted from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/opt from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/run from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/spool from / (/dev/sda1).
May 27 21:21:02 ubuntu clear_partitions: Removing var/tmp from / (/dev/sda1).
May 27 21:21:02 ubuntu kernel: [ 625.522422] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: errors=remount-ro
基本上,目录 bin、dev、etc、lib、lib32、lib64、proc、sbin 和 sys 以及 usr 和 var 的内容都被删除了(/usr/local 和 /var/local 似乎是个例外,但我在 usr 和 var 中的测试文件夹被删除了)。 boot 目录似乎没有被删除,只是被与 grub 和内核相关的软件包覆盖了。
答案2
我现在对 ubiquity 很恼火。我告诉 15.04beta2 的安装程序在 md 设备/
上使用raid10f2
,无需格式化。很好,我已经在该设备上做了 mkfs.xfs。我还告诉它使用我现有的/home
和/var/tmp
md
设备,无需格式化。 /home
幸存了下来,但我的/var/tmp
现在是空的!
这到底是怎么回事?这是一个明确定义的地方,用于存储持久的用户数据。我没有丢失任何无法找到并重新下载或从其他机器备份的东西,但这很不酷。我没想到警告对话框甚至没有提到根文件系统以外的分区。(我以为我会收到另一个关于设备安装的/var/tmp
具体警告,如果它要安装在某个不安全的地方rm -r
。)
我知道告诉安装程序我的其他文件系统(而不是稍后编辑 fstab)会有一点风险,但这太愚蠢了。
所以无论如何,Ubiquity 击败的目录列表包括/var/tmp
,但不包括/home
。
已打开https://bugs.launchpad.net/ubuntu-manual-tests/+bug/1445196