Bug#833525: debootstrap: Deleted my entire /home partition using "mostly harmless" debootstrap --print-debs option
*** Reporter, please consider answering these questions, where appropriate ***
* What led up to the situation?
0) Okay, this will be embarrassing...
1) Occasional need to work on i386 software on an x86-64 machine.
2) Previous experiment led to a marginally usable "minimal" /chroot/i386 partition (without internet connection)
3) Desire to add internet connection to same, start by listing packages which would be installed by "debootstrap --print-debs"
4) Failure to understand that "debootstrap --print-debs" operated by performing the entire debootstrap operation,
listing packages, then deleting the created directory, despite a note in the manfile to that effect.
5) Further failure to note that such deletion would apply recursively to any automounted partitions in said created directory.
6) Previous experiment involved automounting /proc, /sys, /var/tp, and /home into said /chroot/i386 partition.
7) Re-using the /chroot/i386 directory name in the "debootstrap --print-files" command. Without the --keep-bootstrop-dir option, since I was about to replace it.
8) I said this was embarassing...
* What exactly did you do (or not do) that was effective (or
Sadly, I no longer have my exact notes, as will become clear. But approximately, the command was (possibly with sudo, or after su):
debootstrap --print-debs /chroot/i386
* What was the outcome of this action?
Well I briefly saw the list of packages flash past, before debootstrap got to the "The TARGET directory will be deleted...." part.
At which point various strange things started happening, until it gradually dawned on me that /home and /var/tmp were slowly disappearing before my eyes...
* What outcome did you expect instead?
Somehow I expected to be left with a list of .deb packages and a functioning computer. I now understand my expectations were unrealistic.
Perhaps I have been punished enough ... and perhaps it would be a good idea to modify the bit of debootstrap that implements
"The TARGET directory will be deleted...." and convince it to stop at automounted partitions in /etc/fstab (and/or mtab)?
It is too late for me, but it might be very pleasing to some future unwary operators to be left with their /home partition intact...
(NB the packages/versions listed below apply to a reinstall, not the exact formerly-running system, for reasons that are hopefully clear)
*** End of the template - remove these template lines ***
-- System Information:
Debian Release: stretch/sid
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages debootstrap depends on:
ii wget 1.18-1
Versions of packages debootstrap recommends:
ii debian-archive-keyring 2014.3
ii gnupg 1.4.20-6
debootstrap suggests no packages.
-- no debconf information