LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-22-2017, 06:52 AM   #1
M.sewaif
LQ Newbie
 
Registered: Sep 2016
Posts: 5

Rep: Reputation: Disabled
Fault Backup try


I`m a new Linux user, I have tried to backup the boot partition using " tar " command as below :
# tar -xf /dev/sda5 /mnt/boot_backup
unfortunately, after reboot I got the " grup rescue " shell & when tried to list any file system ( ls (hd0,msdos5)/grup2) I`m getting an error message " unknown filesystem"

finally I tried to extract the /mnt/boot_backup using Centos 7 DVD using the following command :
# tar -xvf /mnt/boot_backup /dev/sda5
but got the following error
tar: At beginning of tape, quitting now
tar: Error is not recoverable: exiting now

Please advice
 
Old 01-22-2017, 03:04 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,236

Rep: Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150
Welcome. An unfortunate introduction to Linux.

Whilst getting an understanding of backups is exemplary, I see several problems:
- as per your second command, the "-x" option is to extract an already existing tar archive. Your first command should have used "-c" (create) instead.
- it is usually unnecessary (and often dangerous) to use device nodes directly - use mountpoint(s) for safety.
- tar archives are files - you need to specify the filename each time.

Perhaps something like the following would do what you wanted - note the order of parameters
Code:
tar -cf /mnt/boot_backup/boot_backup.tar /boot
As for your problem, I'm surprised that first command did anything at all, but it looks like it opened then closed the device node, and effectively emptied it. From the Centos liveDVD, run these to get some idea of what's what.
Code:
df -hT
ls /run/boot
On that second command, substitute as appropriate to get th on-disk boot partition listed.
 
Old 01-23-2017, 01:46 PM   #3
M.sewaif
LQ Newbie
 
Registered: Sep 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks Dear for your replay

First of all, I had already executed the " tar " command with " cf " option not as mentioned in my previous post.

secondly, I have ran these two commands as per your advice and got the attached result.

Is it mean as you told that the device node for boot partition had been emptied ???
Attached Thumbnails
Click image for larger version

Name:	WhatsApp Image 2017-01-23 at 10.34.06 PM.jpeg
Views:	15
Size:	252.3 KB
ID:	24040  
 
Old 01-23-2017, 02:34 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,105

Rep: Reputation: 6059Reputation: 6059Reputation: 6059Reputation: 6059Reputation: 6059Reputation: 6059Reputation: 6059Reputation: 6059Reputation: 6059Reputation: 6059Reputation: 6059
In addition to what syg00 posted the correct syntax for tar is:

tar -cf /destination/file files_to_be_tarred

Which means you over wrote part of /dev/sda5 with the contents of /mnt/boot_backup. So what was sda5? Can you post the output of the command lsblk?
 
Old 01-23-2017, 04:32 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,236

Rep: Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150
That output looks like the on-disk system, and doesn't show much. But it did boot.
As well as the "lsblk" output, let's see this
Code:
sudo mount /dev/sda5 /mnt
ls -al /mnt
sudo umount /mnt
 
Old 01-24-2017, 07:05 AM   #6
M.sewaif
LQ Newbie
 
Registered: Sep 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Dear SYG00 & Michealk
Thank for you interest , but unfortunately I have installed a fresh Centos 7image .
Can you please guide me to creat system state backup or restore point (I'm MCSE so may be these are microsoft expressions )
 
Old 01-24-2017, 07:26 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,627

Rep: Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524
there is no "restore point" in the linux world - or at least it is not similar to the restore point used by MS-Windows.
You can use a lot of different tools to back up your system, but actually you may need to boot another OS (livecd) to be able to save the content of the root partition. dd can be used to do that, but without knowing your system (what to backup, where to) we cannot give you better answer.
 
Old 01-24-2017, 07:56 AM   #8
M.sewaif
LQ Newbie
 
Registered: Sep 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
I forgot to tell that I'm using CentOS 7
 
Old 01-24-2017, 08:22 AM   #9
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,627

Rep: Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524Reputation: 7524
no, you did not forget, that was mentioned in the first post
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Bonding of for fault-tolerance (active-backup) vikas027 Linux - Networking 4 04-03-2013 12:02 PM
Fault-tolerant backup to DVD too Ulysses_ Linux - Server 3 03-11-2013 10:57 PM
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
Backup nightmare - segmentation fault renton Linux - Newbie 4 03-16-2004 04:04 PM

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

All times are GMT -5. The time now is 11:34 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