From: unruh@invalid.ca   
      
   On 2022-10-12, MSC-223 wrote:   
   > I'm a student learning software engineering and I accidentally deleted my   
   /root directory, is there a way I can recover my lost dir with it's   
   configurations? Please I need help because I can't do my projects without   
   navigating cd /root.   
      
   Unless you made a backup, no. But the configuration should be the same   
   as it was when it was originally created.   
      
   Can you log in as a user (or were you doing everything as root?).   
      
   Get a Live distribution. -- Mageia, Mandriva, redhat, whatever.   
   boot intot he live distribution. mount the / partition of your Mandriva   
   disk somewhere (eg mkdir /mnt/disk;mount /dev/sda5 /mnt/disk (where you   
   replace /dev/sda5 with your / partition location.)   
   mkdir /mnt/disk/root   
   rsync -av /root/ /mnt/disk/root   
   or   
   cp -p /root/* /root/.??* /mnt/disk/root   
   (Note that ?? is crucial. Otherwise you will fill up the /mnt/root with   
   junk-- in particular, your whole disk will be copied into /root)   
      
   NOw you should be able to boot up and su into root.   
      
   IF YOU ARE RUNNING REGULARLY AS ROOT, STOP IT. Do everything as a a   
   user, except things which absolutley need to be done as root, and get   
   out of root as soon as possible.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|