LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-09-2006, 02:09 PM   #16
d0odman
Member
 
Registered: Sep 2004
Location: CA, USA
Distribution: Slackware 10.2
Posts: 132

Rep: Reputation: 15

How long did you stay logged in under your live CD? Sorry about that. The prolem is, you don't have any devices in your backup dev directory. The listing you have there is for the devices that your live CD provides. What you want to do, is copy everything in the /dev directory to the dev directory in your backup.
Code:
mount /dev/hda2 <somewhere>
mount /dev/hda3 <somewhere_else>
tar -zxpvf <somewhere_else>/<path_to_backup>.gz -C <somewhere>
mkdir <somewhere>/dev <somewhere>/proc <somewhere>/sys <somewhere>/tmp
mount -t proc <somewhere>/proc proc
mount -t sysfs <somewhere>/sys sys
cp -rvf /dev/* <somewhere>/dev
cd <somewhere>
chroot .
If you successfully chroot, you should be ok.

Last edited by d0odman; 04-09-2006 at 02:10 PM.
 
Old 04-09-2006, 02:59 PM   #17
JerryMcFarts
Member
 
Registered: Mar 2004
Location: Ohio, USA
Distribution: Ubuntu 6.04
Posts: 117

Original Poster
Rep: Reputation: 15
Talking

W00t~~!!!!! IT WORKED!!! What i believe happened was the -p option wasn't enough for what I was doing.

I used this command:
Code:
tar -zxcvf my-backup.tar.gz --same-permissions /
and rebooted and it worked. that's the only thing i believe i did different.

d0odman!! You are the greatest!! Thank you for your diligent help!


Quote:
cp -rvf /dev/* <somewhere>/dev
I never did that since I was extracting the tar.file onto the filesystem and the /dev wasn't being touched from the initial install and so it was populated already.

the "ls -la /dev" file below was when I was chroot-ed into the environment

Now I still want to test this again, To see if i can do this again.

But
I am at college and i need to work on my studies, but I will defiantly come back and retry this again when i have time, and finish this post.

There are still some questions I have found while searching for my answer:

1. What is the -P option actually do? Directories?
Quote:
-P, --absolute-names
don’t strip leading ‘/’s from file names
2. If I were to backup to a clean harddrive, what else should be looked at?
concerning /dev/ , /grub , anything else?
d0odman was right on track with what needs to be done. (thank you)


I found this link
which I think is really cool, but not entirely in my direction, but people can read up on there.

thank you d0odman
 
Old 04-09-2006, 03:06 PM   #18
d0odman
Member
 
Registered: Sep 2004
Location: CA, USA
Distribution: Slackware 10.2
Posts: 132

Rep: Reputation: 15
Oh, that's interesting. I guess I misread what you had earlier. I thought that you couldn't chroot into your backup because of bad/nonexistant permissions in your backup dev directory. I'm glad you got it figured out!

Last edited by d0odman; 04-09-2006 at 03:07 PM.
 
Old 04-09-2006, 03:19 PM   #19
d0odman
Member
 
Registered: Sep 2004
Location: CA, USA
Distribution: Slackware 10.2
Posts: 132

Rep: Reputation: 15
Oh yeah, while tar is good to use to package a whole bunch of files, I don't think it's very powerful for backups. What's useful about using tar is that you can pick out a certain file to restore. For incremental backups, it would be more useful than what I usually do.

When I set up a new Slackware machine, I inevitably end up screwing with it. Usually to the point of making it not work. So, to prevent that, I use dd to make a raw copy of the partition I installed to, that way, when it goes south, I can restore it to a state where it will work again. Say I installed to the same partition you've been using. I'd then do something like this:
Code:
dd if=/dev/hda2 of=/mnt/backups/<date_of_backup>.<name_of_machine>
Now, when I want to restore, I just reverse if and of:
Code:
dd of=<path_to_backup>/<date_of_backup>.<name_of_machine>
One of the best parts of dd, is that you can raw copy a whole disk, and preserve the partition table information. BTDT, with an old panasonic 8GB laptop. I was able to save the drive's rescue disc pristine state (bought it used with no restore media), and put together a boot disk that I burned to CD along with the backup files that did nothing but prompt a user if it wanted to restore the images. The backup was pretty easy to do, the hard/long part was writing the scripts to do all of that.

So, if you want to just back up a few files, use tar, but use dd for a full norton ghost type backup. There's no reason you can't tar up the back up you did using dd, either, to compress the resulting backup.
 
Old 04-10-2006, 02:30 PM   #20
JerryMcFarts
Member
 
Registered: Mar 2004
Location: Ohio, USA
Distribution: Ubuntu 6.04
Posts: 117

Original Poster
Rep: Reputation: 15
question about dd
does it just copy data? or also blank space?

because my main partition(22GB) is bigger than my backup partition (8GB)
 
Old 04-10-2006, 03:43 PM   #21
d0odman
Member
 
Registered: Sep 2004
Location: CA, USA
Distribution: Slackware 10.2
Posts: 132

Rep: Reputation: 15
Yes, it copies blank space as well, so it wouldn't work for you. There's a way to pipe the output through tar to compress it (I did an 8GB drive over 6 750MB CDs, with room to spare), but I don't know if you can do it directly.
 
Old 04-10-2006, 04:32 PM   #22
JerryMcFarts
Member
 
Registered: Mar 2004
Location: Ohio, USA
Distribution: Ubuntu 6.04
Posts: 117

Original Poster
Rep: Reputation: 15
I would be interested in that exact script you used.
 
Old 04-11-2006, 02:28 AM   #23
d0odman
Member
 
Registered: Sep 2004
Location: CA, USA
Distribution: Slackware 10.2
Posts: 132

Rep: Reputation: 15
I'll give you the boot disk I used for it. I just have to find it. It's somewhere in the digital void I call a file server, somewhere... When I find it, I'll bump this thread.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backing up hard drive to a network computer Baix Linux - General 1 07-26-2005 02:41 PM
backing up help with tar dannyk1 Linux - Newbie 5 08-22-2004 06:25 AM
Backing up with tar rooch84 Linux - Software 2 08-20-2004 02:30 AM
Going to format computer what files need backing up? MAcbeth Linux - Newbie 2 06-29-2004 08:25 AM
Exclude directories when backing up with 'tar'? wolfpeach Linux - Newbie 2 06-28-2004 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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