Ubuntu installed by copying system files does not boot

I tried to move an existing Ubuntu installation to a new partition by copying all files while running from LiveCD. In the end, the new system gets stuck at boot process.

What did I do

  1. Booted LiveCD.
  2. Mounted both old and new partitions.
  3. Used something like cp -a /mnt/old_root/* /mnt/new_root to copy the files, which supposedly preserves file metadata. (Maybe I should try other options)
  4. Corrected /etc/fstab on the new system.
  5. Reinstalled GRUB by following these steps in the first attempt and these steps in the second attempt.
  6. Tried to boot the new system.
  7. Fixed this problem but it was not the cause.

UPD: I tried to do the same steps on a newly installed system and got the same result.

Unimportant details:

  1. I run the system in VirtualBox Version 6.0.5 r128870
  2. The system is Ubuntu 18.04.2 LTS; Linux 4.15.0-45-generic.

What did I get

  • The system boot begins.
  • It looks like the system successfully mounts / and /home. (When there was a mistake in /etc/fstab the system quickly dropped to maintenance shell)
  • The system boot gets stuck in the animated splash screen.
  • If I hide the splash screen, I can see the same services fail to start over and over again. The system almost does not utilise CPU or storage.Boot console screenshot
  • I can boot to recovery mode from GRUB.
  • The first error messages from journal:
2019-02-19T18:29:37+0000 hostname systemd[1]: Reached target Sockets.
2019-02-19T18:29:37+0000 hostname systemd[1]: Reached target Basic System.
2019-02-19T18:29:37+0000 hostname systemd[1]: Started D-Bus System Message Bus.
2019-02-19T18:29:37+0000 hostname dbus-daemon[1104]: dbus[1104]: Unknown group "power" in message bus configuration file
2019-02-19T18:31:07+0000 hostname systemd[1]: Failed to get initial list of names: Connection timed out
2019-02-19T18:31:07+0000 hostname systemd[1]: Failed to set up API bus: Connection timed out
2019-02-19T18:31:07+0000 hostname systemd[1]: Error occured during D-Bus APIs initialization: Connection timed out
2019-02-19T18:31:07+0000 hostname systemd[1]: Starting Login Service...
2019-02-19T18:31:07+0000 hostname systemd[1]: Starting System Logging Service...
2019-02-19T18:31:07+0000 hostname systemd[1]: Starting firewalld - dynamic firewall daemon...
2019-02-19T18:31:07+0000 hostname systemd[1]: Starting Detect the available GPUs and deal with any system changes...
2019-02-19T18:31:07+0000 hostname systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
2019-02-19T18:31:07+0000 hostname systemd[1]: Started CUPS Scheduler.
2019-02-19T18:31:07+0000 hostname systemd[1]: Starting LSB: OpenIPMI Driver init script...
2019-02-19T18:31:07+0000 hostname systemd[1]: Starting WPA supplicant...
2019-02-19T18:31:08+0000 hostname avahi-daemon[1138]: Found user 'avahi' (UID 115) and group 'avahi' (GID 122).
2019-02-19T18:31:08+0000 hostname avahi-daemon[1138]: Successfully dropped root privileges.
2019-02-19T18:31:08+0000 hostname avahi-daemon[1138]: open(/run/avahi-daemon//pid): Permission denied
2019-02-19T18:31:08+0000 hostname avahi-daemon[1138]: Failed to create PID file: Permission denied
  • Messages like these are repeated every 90 seconds. As I understand, dbus-daemon dies.
2019-02-19T20:53:47+0000 hostname systemd[1]: Failed to get initial list of names: Connection timed out
2019-02-19T20:53:47+0000 hostname systemd[1]: Failed to set up API bus: Connection timed out
2019-02-19T20:53:47+0000 hostname systemd[1]: Error occured during D-Bus APIs initialization: Connection timed out
2019-02-19T20:53:47+0000 hostname systemd[1]: Starting Network Manager...
2019-02-19T20:53:47+0000 hostname systemd[1]: dbus.service: Main process exited, code=exited, status=1/FAILURE
2019-02-19T20:53:47+0000 hostname systemd[1]: dbus.service: Failed with result 'exit-code'.
2019-02-19T20:53:47+0000 hostname systemd[1]: rsyslog.service: Start operation timed out. Terminating.
2019-02-19T20:53:47+0000 hostname systemd[1]: whoopsie.service: Service hold-off time over, scheduling restart.
2019-02-19T20:53:47+0000 hostname systemd[1]: whoopsie.service: Scheduled restart job, restart counter is at 7.
2019-02-19T20:53:47+0000 hostname systemd[1]: Started D-Bus System Message Bus.
2019-02-19T20:53:47+0000 hostname dbus-daemon[4650]: dbus[4650]: Unknown group "power" in message bus configuration file
2019-02-19T20:53:47+0000 hostname NetworkManager[4644]: <info> [1550609627.2637] NetworkManager (version 1.10.6) is starting... (after a restart)
2019-02-19T20:53:47+0000 hostname NetworkManager[4644]: <info> [1550609627.2641] Read config: /etc/NetworkManager/NetworkManager.conf (lib: 10-dns-resolved.conf, 20-connectivity-ubuntu.conf, no-mac-addr-change.conf) (run: netplan.conf) (etc: 10-globally-managed-devices.conf, 10-ubuntu-fan.conf, default-wifi-powersave-on.conf)
2019-02-19T20:55:17+0000 hostname systemd[1]: Failed to get initial list of names: Connection timed out
2019-02-19T20:55:17+0000 hostname systemd[1]: Failed to set up API bus: Connection timed out
2019-02-19T20:55:17+0000 hostname systemd[1]: Error occured during D-Bus APIs initialization: Connection timed out
2019-02-19T20:55:17+0000 hostname systemd[1]: Stopped crash report submission daemon.
2019-02-19T20:55:17+0000 hostname systemd[1]: Started crash report submission daemon.
2019-02-19T20:55:17+0000 hostname systemd[1]: rsyslog.service: Main process exited, code=killed, status=6/ABRT
2019-02-19T20:55:17+0000 hostname systemd[1]: rsyslog.service: Failed with result 'timeout'.
2019-02-19T20:55:17+0000 hostname systemd[1]: Failed to start System Logging Service.
2019-02-19T20:55:17+0000 hostname systemd[1]: dbus.service: Main process exited, code=exited, status=1/FAILURE
2019-02-19T20:55:17+0000 hostname systemd[1]: dbus.service: Failed with result 'exit-code'.
2019-02-19T20:55:17+0000 hostname systemd[1]: NetworkManager.service: Start operation timed out. Terminating.
2019-02-19T20:55:17+0000 hostname systemd[1]: Started D-Bus System Message Bus.
2019-02-19T20:55:17+0000 hostname whoopsie[4678]: [20:55:17] Could not create lock directory.
2019-02-19T20:55:17+0000 hostname whoopsie[4678]: [20:55:17] Using lock path: /var/lock/whoopsie/lock
2019-02-19T20:55:17+0000 hostname whoopsie[4678]: [20:55:17] Could not create lock file: Bad file descriptor
2019-02-19T20:55:17+0000 hostname whoopsie[4678]: [20:55:17] Could not read directory (13): /var/crash
2019-02-19T20:55:17+0000 hostname dbus-daemon[4685]: dbus[4685]: Unknown group "power" in message bus configuration file
2019-02-19T20:55:17+0000 hostname snapd[1246]: udevmon.go:190: udev monitor observed remove event for unknown device "/sys/dentry(4893:whoopsie.service)"

The question

  1. Was cp -a expected to work?
  2. Where is the difference between the old and the new partition?
  3. Should I dig into the boot issue itself?
0

2 Answers

Thank to this post, I was able to resolve the problem by executing the following commands in the recovery shell:

chown root:root /
chmod 755 /

The new system works fine so cp -a method is probably OK. The problem was that the root directory had wrong permissions. (As I understand, the directory got its permissions when I formatted the partition; and they obviously stayed the same when I copied the system files inside the directory).

It will cause you more problems with the permissions as you continue to use the system, you should use option to preserve permissions like tar cpf -|(cd /newmount;tar xvpf -) or rsync -avzt source/ /dest (in rsync watch out the trailing slash character)

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like