Hi,

Need some advise if I'm on the wrong path.

GOAL: Backup data (/home and /volx) , Re-format a GNU/Linux system and 
Re-install fresh from scratch. But I do not want to recreate the users and 
passwords...

This is that I'm planning to do after restoring the /home folder.

1. Overwrite the following files from the old hard disk
        /etc/passwd
        /etc/shadow
        /etc/group
        /etc/gshadow

2. Reset ownership of files and folders since they may not match.

Sample script:

 This could be addressed by running a for loop:
 -------------------- -------------------- --------------------
       USERS=`awk -F: '{print $1}' /etc/passwd`
       for USER in $USERS ; do
               chown -R $USER /home/$USER
               chown $USER /var/spool/mail/$USER
       done
 -------------------- -------------------- --------------------

I have created a lot of groups folder in a folder called /vol1 and /vol2

  -------------------- -------------------- --------------------

       GROUPS=`awk -F: '{print $1}' /etc/group`
       for GROUP in $GROUPS ; do
               chown -R :$GROUP /vol?/$GROUP
       done
 -------------------- -------------------- --------------------
 

Any comments on this approach being good / bad or flawed?

Regards

Rishi


-- 
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

Reply via email to