3

So i accidentally run the command:

sudo chmod -R 2777 /

Wenever i login, it would only bring up the bash command line interface. Now how can i backup my system using only bash commands?

i have tried some post:

http://ubuntuforums.org/showthread.php?t=1422712

sudo tar cvpzf ../../home/$backupUser/backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys --exclude=/media /

but requires sudo, which i can't do right now.

Fabby
  • 34,259
  • Success with the back-up. Restoring is just drag and drop of the directories you need after you reinstall your system. ;-) – Fabby Mar 15 '16 at 15:44
  • Thanks :) but i tried your method on on a live USB and it worked. i'm using ubuntu server 14.04 btw, so no drag and drop for me. – John Pangilinan Mar 16 '16 at 00:23
  • :D Just a reversal of the cp then! ;-) You're welcome! – Fabby Mar 16 '16 at 00:43

1 Answers1

3

Insert an external HDD formatted on another machine using FAT if none of your files are >4GB and type the following command:

ls /media/$USER

That will give you a list of names one of which is your hard drive. Then copy the files over by issuing:

cp --verbose /home/$USER/* /media/$USER/NameOfHDD

Where you substitute NameOfHDD for the name you found previously (I cannot tell you which: it depends on the HDD itself and how it was formatted)

And then you wait until it finishes...

To restore just type:

cp --verbose /media/$USER/NameOfHDD/* /Home/$USER/

(if both user names before and after re-install are the same!)

Fabby
  • 34,259