Find the answer to your Linux question:
Results 1 to 8 of 8
My main system is Arch 64. I recently changed disks and rsynced over all partitions ("/" and "/boot") to the new one. In the process, I had to change permissions ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    61

    Question [solved] System malfunctions after restore (wrong permissions)


    My main system is Arch 64. I recently changed disks and rsynced over all partitions ("/" and "/boot") to the new one. In the process, I had to change permissions on files because I was doing it form another distro (Ubuntu).

    I can login to X, but then most of things won't run.

    I am sure it has something to do with permissions on file system because I changed them before on both / and /boot partitions using
    Code:
    sudo chown -R $USER:$USER <Mount Point>
    I subsequently tried fixing it form Ubuntu using the same method:
    Code:
    root:root for /
    juha:users for /home/juha
    root:root for /boot
    and as mentioned, I am now able to login, but most of things still don't work (for example, sudo, terminal etc, etc).

    The problem is this is my private and work laptop so now I have to run it on livecd Ubuntu which is tedious...
    Last edited by Lockheed; 06-27-2011 at 07:59 PM.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    It would take a lot of effort to get everything running correctly, using such a technique. Why did you rsync your "/" partition, do you have data you care about?

    If I were you, I'd just back up the files/directories of importance to some network or USB-accessible storage and install your Linux OS of choice from scratch.

  3. #3
    Just Joined!
    Join Date
    Nov 2007
    Posts
    61
    Why is it so difficult if it's just permissions and there is only root and one user on the system?
    Yes, it took me few months to bring this system to the current state and I would not like to repeat it.

    Is there some command I can run to reinstall all installed packages? For pacman or yaourt? After all, they keep track of everything that's installed on the system.
    Last edited by Lockheed; 06-27-2011 at 06:00 PM.

  4. #4
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    B/c it is potentially a lot of files/directories that need to be changed, which has nothing to do w/the amount of users on the system.

    if you want to keep everything as is, then maybe you could install a similar working Linux distro on another machine, then compare permissions. this command, run on the working machine, would give you a list of files, dirs, etc. and their respective permissions:

    Code:
    find $DIR -printf "%p: " -exec stat -c %a {} \;
    and substitute $DIR for your high-level directory, e.g. "/usr" or even "/" (but that would be a LONG list! and really, you should exclude dirs like /sys and /proc which are created at boot time. Come to think of it, the /dev directory is a very important one, permissions-wise, and you should pay attention to it).

    can you possibly just reinstall the applications that are not working properly, which should not affect data itself? I'm not familiar w/Arch, but there should be some sort of package verification, I would hope.

    In any event, try tailing /var/log/messages in one terminal (and possibly /var/log/secure in another), then log into X and start trying to run things, and see what errors (if any) gets logged to messages (or secure). hopefully, if something is broke - it is related to permissions and a helpful error message is logged there.

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,512
    Well, you are in it now because of how you backed up your system drive. Using rsync for data is one thing. Using it for the system drive where there are a lot of special files that cannot really be rsync'd is something else entirely. My recommendation is that to backup/restore the system drive is that you do a bit-image backup of the entire hdd and if you have to restore, then you can use dd to write the entire system back to the drive. Using rsync on things like /etc is fine, but on / is just asking for trouble.

    What I do:

    1. Make regular bit-image backup of system drive.
    2. Rsync /etc to keep configuration data up-to-date.
    3. If need to restore system, us dd to write bit-image back to system drive and then restore /etc changes.

    This has worked well for me in the past, allowing me to reasonably quickly restore the system to a known good state.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #6
    Just Joined!
    Join Date
    Nov 2007
    Posts
    61
    Man, I rule. For anyone else running into this problem:

    Code:
    pacman -S $(pacman -Qq | grep -v "$(pacman -Qmq)")
    then
    Code:
    sudo chown -R $USER:$USER /home/$USER
    and voila - system works like a charm.

  7. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,512
    Great! Unfortunately, I don't use Arch Linux, so I'm not familiar with pacman. As a result, I gave you the best info I had under the circumstances. In any case, we're glad you got things sorted out!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #8
    Just Joined!
    Join Date
    Nov 2007
    Posts
    61
    Thanks all!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •