Bug 173180 - freebsd-update(8) wipes system files (file size is zero) and makes the operation system not available either over consoles or network.
Summary: freebsd-update(8) wipes system files (file size is zero) and makes the operat...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-29 04:40 UTC by Alexander Verbod
Modified: 2019-03-12 23:00 UTC (History)
2 users (show)

See Also:


Attachments
file.txt (857 bytes, text/plain)
2012-10-29 04:40 UTC, Alexander Verbod
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Verbod 2012-10-29 04:40:00 UTC
If FreeBSD installed on a hardware or virtual machines(include VPS{Virtual Private Server}) with RAM memory equal 128Mb or less
freebsd-update(8) corrupts files in system directories /bin, /lib, reboot OS without any confirmation 
and upon start up freeze up OS because of most important files in the /bin and /lib directories are zero size, 
which makes system not accessible from any consoles and over network. 
Final result of binary upgrade will be unrecoverable system in case of installation was done on a VPS with an external provider.
The only access is via single mode, but since most important programs and libraries are absent, /rescue isn't a helper, especially after someone removed nc(1) from /rescue on the FreeBSD 9
(BTW, /rescue/rcp isn't work too, and will say that it can't start under user 0. I'll supply additional PR on it.)

Screen shots made in single mode attached:

http://s17.postimage.org/gbi9bp4n3/001_host_under_KVM.jpg
http://s10.postimage.org/6f9ly4mvd/002_attempt_to_run_freebsd_update_install_after.jpg
http://s10.postimage.org/mws0b9xvt/003_freebsd_update_IDS.jpg
http://s11.postimage.org/4uzcjsp1v/004_attempt_to_run_netif_start.jpg
http://s10.postimage.org/8ixtb0qtl/005_root_bin.jpg
http://s13.postimage.org/sz4jigw7b/006_root_lib.jpg
http://s12.postimage.org/3naue308t/007_system_isnot_overfilled_df.jpg
http://s11.postimage.org/t96tix0wj/008_UNAME_after_reboot.jpg
http://s8.postimage.org/4dizmrdj9/100_host_under_Virtual_Box_after_reboot.png

Fix: Do not use freebsd-update(8) until it will be fixed(at least on VPS with a low memory).

=======================
For those who get this issue and need to save important files before initiating re-installation use command sequence described in attachment

Patch attached with submission follows:
How-To-Repeat: It can be absolutely fresh installed system with default settings, without any additional software installed. The only sshd(8) service is activated.
Issue easily repeated under any virtual machines or on a VPS (it was first detected on VPS based on QEMU-KVM, then tested on XEN and tested also under VirtualBox) platforms that provided resources for the FreeBSD guest OS.
Maximum available RAM(Random Access Memory)memory is equal to 128 Mb. 
Swap size is 153Mb, which  was set by FreeBSD installer as default auto-configured option. 
After this issue was discovered, we tried to setup the same system with 384Mb swap, but it doesn't help too.
Hard drive space isn't an issue since on a moment of attempt to upgrade and after there are more then 1 Gigabytes of free space, so for a test it is enough to setup 3Gb HDD space.

To reproduce an issue run standard recommended sequence described here: http://lists.freebsd.org/pipermail/freebsd-stable/2012-October/069998.html

freebsd-update upgrade -r 9.1-RC2
freebsd-update install
shutdown -r now
freebsd-update install

After the last step, a system will self reboot and never back online.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-04-14 00:24:27 UTC
Responsible Changed
From-To: freebsd-bugs->cperciva

Over to maintainer.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:47:59 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 3 Colin Percival freebsd_committer freebsd_triage 2019-03-12 23:00:01 UTC
Drop freebsd-update PRs which were assigned to me.  I'm not working on this code any more.