0

I used to copy my system/config files from lvm-based /dev/mapper/devuan--vg-root + /dev/mapper/devuan--vg-home partitions into external storage and moved them to a fresh btrfs partition after installing Windows. Unfortunately, I forgot to copy the rest from the lvm-based /dev/mapper/devuan--vg-var + /dev/mapper/devuan--vg-tmp partitions.

Problems

After I set and installed grub, I was able to boot the system, but:

  1. The system stops loading at the following error message:

    fsck from util-linux 2.27.1
    /bin/fsck.btrfs: /dev/mapper/devuan--vg-home does not exist
    /bin/fsck.btrfs: /dev/mapper/devuan--vg-tmp does not exist
    /bin/fsck.btrfs: /dev/mapper/devuan--vg-var does not exist
    fsck exited with status code 8
    
  2. I got other errors as well, due to the missing /var/* folders for some servers such as cron and exim4 - at that point, I managed to create them manually, as well as copying the required files of /var/lib/dpkg/* and /var/cache/dpkg/* folders from xubuntu livecd.

The only solution I found for the fsck errors, is to touch /fastboot, but this is limited to the next boot (i.e not permanent solution).

After the next boot, I got xdm looping over login although xdm labeled my credentials as "Successful" - I mean, there is an issue while logging into the system as a user (non-root), while logging in as root works fine. Moreover, whenever I enter su kais (kais is my username), I get the following message displayed:

cannot execute /bin/bash: Permission Denied

But that is not the case when typing just su (root).

I tried to solve the problem by changing permissions for /home/kais using chmod 777 /home/kais -R and chown kais /home/kais -R, as well as setting the most suitable permissions for /root directory using chmod 755 /root -R - but failed to do so.

Further informations

  1. Output of ls -l /bin/bash

    -rwxrwxrwx 1 kais root 1099016 Oct 14 19:25 /bin/bash
    

Questions

  1. How can I fix the login problem?
  2. How can I disable lvm partitions' check on boot (I mean uninstall lvm completely) permanently?
  3. What tool could you suggest for backing up and restoring the system + user data from lvm partitions' filesystem, more efficiently in the future?
  • This feels like you forgot to copy file permissions (either during the backup or the restore). What is result of ls -l /bin/bash? – roaima Oct 16 '17 at 23:02
  • In your question please also provide the same ls -l, but this time from your backup. – roaima Oct 17 '17 at 7:27
  • @roaima What do you mean by 'from my backup'? – Kais Oct 17 '17 at 8:17
  • Do you still have your backup? I'd like to see the result of running ls -l for the file /bin/bash as stored in your backup, to ascertain whether or not your backup has any additional value we can extract. – roaima Oct 17 '17 at 13:50
  • @roaima Nope. I moved all the system+config files. Only the videos + docs are remaining within the backup. – Kais Oct 17 '17 at 14:22
2

You've failed to restore the file ownerships and permissions for the OS files. I'm quite impressed the system boots and allows root to log in.

If you took good backups you should be able to wipe and restore properly. Otherwise you'll need to reinstall from scratch and then restore the files from your home directory.

It should theoretically be possible to reapply the deb packages you already have installed, but without the package database in /var that's next to impossible.


To answer your specific questions you've added,

  1. Reinstall or restore from a known-good backup. You don't have the backup so that leaves you only one choice.
  2. You have no database of installed packages so you would have to pick off the LVM tools (programs, libraries, configuration files) one by one. See #1
  3. There are many options. Here are a few

Next time I'd suggest you install local tools under either /usr/local/ (for example /usr/local/bin/wais) or /opt. You can then copy them off to a new system trivially.

  • ok. but how can I fix the permissions in order to allow non-root users to log in? – Kais Oct 16 '17 at 23:39
  • @Kais I've already answered that. – roaima Oct 16 '17 at 23:57
  • I can't reinstall from scratch, as I will lose many tools I installed manually. – Kais Oct 17 '17 at 0:38
  • I think reinstalling from scratch is the best solution for my case (I need to get back to Debian. BTW have you heard of the 'stretch' version?) - I backed up [/home /usr /root /etc] within tar archive, so I will investigate them to update all my configs manually + re-install the binaries. Thanks for your help. – Kais Oct 18 '17 at 0:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.