LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-26-2011, 01:57 AM   #1
Novartum
Member
 
Registered: Feb 2011
Location: France
Distribution: Arch Linux
Posts: 32

Rep: Reputation: 4
Arch Linux - Backup (may have overwritten partitions)


Hello,
so I have ran into some catastrophic trouble. I was trying to backup my arch linux setup with rsync to my external hard drive but have instead rendered the system unbootable. I followed these instruction https://wiki.archlinux.org/index.php...kup_with_rsync.

First I created file "rbackup.sh"
Code:
#!/bin/sh
# rsync backup script

sudo sh -c "
    rsync -av --delete-excluded --exclude-from=backup.lst / $1;
    touch $1/BACKUP
"
then "backup.lst" with exclusions
Code:
# Include
+ /dev/console
+ /dev/initctl
+ /dev/null
+ /dev/zero

# Exclude
- /dev/*
- /proc/*
- /sys/*
- /tmp/*
- *lost+found
- /media/backup/*
Then I created directory "backup" in /media (hence it's inclusion in the last file to avoid an infinite backup loop).

# mount /dev/sdb1 /media/backup
# ./rbackup.sh /media/backup/

Then I changed the fstab in the backup drive to this (as prescribed in guide):
Code:
/dev/pts      devpts    defaults      0 0
/dev/shm      tmpfs     defaults      0 0

/dev/sdb1    /             ext3      defaults      0 1
At this point I had to leave my room for a short while so I unmounted and shut it off. When I returned the system was unbootable. I get the following error at the filesystem check:

Code:
Checking File Systems                    [BUSY]
Fsck.ext3: No such file on directory while trying to open /dev/sdb1
Possibly non-existent device?

File system check failed.
Give root password for maintenance
(or type Control-D to continue):
When I type password, I immediately notice that things are wrong as bash shows root@(empty): (rather than @my alias).

And everything seems to be gone (my user in /home/ is gone) and no commands work (e.g. vi, nano, sudo, pacman, anything). All the expected directories in / exist but it seems like things were moved to my backup. Luckily, the backup does seem to have all the files that I had asked it to copy over. What could have happened and what should I do now? Thank you for any help.

Last edited by Novartum; 03-26-2011 at 02:08 AM.
 
Old 03-26-2011, 03:00 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I would say you altered the wrong fstab.
 
Old 03-26-2011, 07:47 AM   #3
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
I think syg00 is right, do you know on which parition was your / directory? please try to mount it from a live-CD and post your old /etc/fstab and the output of
Code:
fdisk -l
Markus
 
Old 03-26-2011, 11:25 AM   #4
Novartum
Member
 
Registered: Feb 2011
Location: France
Distribution: Arch Linux
Posts: 32

Original Poster
Rep: Reputation: 4
Thank you for the responses. I do believe that I have edited the wrong file. How do I mount / and edit the file from a live cd? I am not able to edit anything currently (i.e. vim doesn't work)
 
Old 03-26-2011, 12:48 PM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
How do I mount / and edit the file from a live cd?
I use a Fedora live CD and just open the File Browser, click on the hard drive (it is visible) and browse it - in that situation you are root...Use gedit to work the file(s)...I do, it works for me...
(testing this NOW to verify...)
EDIT - verified : use a live CD and just browse the drive, tested with a Fedora 14 LXDE...

BTW, dude, you freak me out...I just hope you can rescue the chinaware...

I'll be watching this thread closely...

Thor

Last edited by ButterflyMelissa; 03-26-2011 at 12:54 PM.
 
Old 03-26-2011, 01:37 PM   #6
Novartum
Member
 
Registered: Feb 2011
Location: France
Distribution: Arch Linux
Posts: 32

Original Poster
Rep: Reputation: 4
Thank you for the tip. Also, does this fstab look correct? I believe this is what I had, but I did not do a backup since I did not intend to edit my main fstab:

Code:
none         /dev/pts      devpts      defaults              0 0
none         /dev/shm      tmpfs       defaults              0 0

/dev/sda5    /boot         ext3        defaults,noatime      0 1
/dev/sda10   swap          swap        defaults,noatime      0 0
/dev/sda3    /             ext3        defaults,noatime      0 1
/dev/sda8    /home         ext3        defaults,noatime      0 1
/dev/sda9    /usr          ext3        defaults,noatime      0 1
/dev/sda7    /tmp          ext3        defaults,noatime      0 1
/dev/sda6    /var          reiserfs    defaults,noatime      0 1
I am unsure about the dump and check options (I believe they were all 0 1 except swap, 0 0) and the mount options (again, believe all were defaults,noatime, besides the first two). Thank you in advance.
 
Old 03-26-2011, 02:05 PM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Which bootloader are you using? if you're using grub, look at the /boot/grub/menu.lst file if the boot and / partitions are set correctly. Then you may try to boot your system. The options in the fstab file are not as much important that they would prevent your system from booting. Otherwise it is important that you have the partitions correctly, at least for /, boot, /var and /usr

Markus
 
Old 03-26-2011, 02:13 PM   #8
Novartum
Member
 
Registered: Feb 2011
Location: France
Distribution: Arch Linux
Posts: 32

Original Poster
Rep: Reputation: 4
Thank you for the response. Well I am entirely sure that the partitions are correctly linked to the appropriate entry (I had a list written down from when I installed arch). So I guess the other options should not affect the boot?

EDIT: Sorry forgot to mention that I am using Grub

Last edited by Novartum; 03-26-2011 at 02:15 PM.
 
Old 03-26-2011, 02:15 PM   #9
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Quote:
Originally Posted by Novartum View Post
... So I guess the other options should not affect the boot?
well, I think the system should boot then.

Markus
 
Old 03-26-2011, 05:29 PM   #10
Novartum
Member
 
Registered: Feb 2011
Location: France
Distribution: Arch Linux
Posts: 32

Original Poster
Rep: Reputation: 4
Ah, it does seem to have worked. The main /etc/fstab was indeed altered and I am once again on Arch. I am actually wondering, are those last two parts of the guide necessary (https://wiki.archlinux.org/index.php...kup_with_rsync)? After doing rsync, I have all of the files that I want backed up on the external hard drive. I don't necessarily need to make the hard drive bootable by changing fstab and installing grub. After just backing up files to hard drive, would it still be possible to restore system if I wanted? Thank you everyone for the help

Last edited by Novartum; 03-26-2011 at 05:40 PM.
 
Old 03-26-2011, 06:45 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Not needed at all.
BTW, regarding the fstab, all you had to do was look at your backup. Perhaps this should be a lesson - always take a (known good) backup before editting system config files. Even if you think it's unnecessary.


Get comfortable with using a liveCD as a rescue - it will save you lots of angst.

Last edited by syg00; 03-26-2011 at 06:47 PM.
 
Old 03-27-2011, 02:48 PM   #12
Novartum
Member
 
Registered: Feb 2011
Location: France
Distribution: Arch Linux
Posts: 32

Original Poster
Rep: Reputation: 4
Yes, lesson learned. Thanks for the help.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Arch Linux Backup Server, part 2 LXer Syndicated Linux News 0 10-29-2010 06:12 PM
[SOLVED] Overwritten HD partitions business_kid Linux - Hardware 6 06-19-2010 02:58 PM
How can I backup/restore different partitions individually? n1c0_ds Linux - Hardware 10 09-07-2009 09:36 AM
LXer: Backup and Restore Linux Partitions Using Partimage LXer Syndicated Linux News 0 01-22-2007 10:54 AM
how come arch won't install to logical partitions? synaptical Arch 2 07-20-2004 05:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration