S
S
speedvm2015-11-16 16:02:42
linux
speedvm, 2015-11-16 16:02:42

How to restore linux from a backup correctly?

Good day!
I made a simple backup of the Fedora 20 system:

sudo tar -cvpzf /path/to/backup.tar.gz --exclude=/path/to/backup.tar.gz --one-file-system /

Then I booted from livecd, mounted the disk, formatted it and uploaded a backup to it:
sudo tar -xvpzf /path/to/backup.tar.gz -C /media/<mount_point> --numeric-owner

I rewrote the partition id in fstab, and installed grub:
grub2-mkconfig -o /boot/grub2/grub.cfg
The system started up, but when I enter the login and password (of any user) in the console, I get the following message: "-- login: no shell: permission denied".
What else needs to be fixed in the files?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
speedvm, 2015-11-18
@speedvm

Looks like the SELinux attributes are off. In this case, you need to create a file in the root and restart the machine:
touch /.autorelabel && reboot

N
Nazar Mokrinsky, 2015-11-16
@nazarpc

If you did this on a live system, then you need to start with the fact that you did the wrong backup.
In your case, you need to at least exclude the /dev /proc /run /sys directories.
To make changes at a minimum, I would mount the root to some other directory, for example, to /mnt, and make a backup of this directory.
And so remove unnecessary directories and look at the logs.

J
jcmvbkbc, 2015-11-16
@jcmvbkbc

I think you have lost all the selinux attributes. So you need to either transfer selinux to permissive or turn it off completely, or backup and restore along with the contexts. See tar options --attrs, --selinux and --xattrs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question