View previous topic :: View next topic |
Author |
Message |
tehdarkknight Tux's lil' helper
Joined: 17 Oct 2005 Posts: 80 Location: /dev/college
|
Posted: Mon Nov 06, 2006 7:39 pm Post subject: How to backup the entire filesystem? |
|
|
I have a hard drive going bad. I need to know how to tarball everything to keep everything intact...
Here's what I have:
1. Mount all my drives from a live CD.
2. tar -cspf archive.tar /*
Will that second line be enough to keep permissions?
Help please, I don't want to go through another install, and have to rebuild my website... _________________ There are 10 kinds of people in the world: People who understand binary and those that don't.
Feel free to IM me to discuss anything as opposed to posting. |
|
Back to top |
|
|
shrimp123 Apprentice
Joined: 02 Sep 2004 Posts: 199 Location: Here!
|
Posted: Mon Nov 06, 2006 7:42 pm Post subject: |
|
|
if the hd is bad/going-bad, here is my suggestion
1. dd the entire disk onto another disk of same(or large disk). this way, even if u messup on the tar, u r in shape
2. use the tar u suggested
whenever i change disks, i do this kind of double backup. (call me pessimistic, but, it gives me some peace of mind)
S |
|
Back to top |
|
|
Twist Guru
Joined: 03 Jan 2003 Posts: 414 Location: San Diego
|
Posted: Mon Nov 06, 2006 8:00 pm Post subject: |
|
|
Why tar if you want to create a working new drive from the current?
-Get a new drive, hook it up as primary, existing drive as secondary
-boot liveCD, partition new drive to look like your old drive
-mount old drive (now secondary) as read only, new drive as read write
-"cp -aR <src> <dest>" for each interesting data partition (this works fine for your root)
-chroot to new drive, run grub/lilo/your bootloader of choice to create the boot block
-remove old secondary drive as a safety backup, boot new drive
-Twist |
|
Back to top |
|
|
tehdarkknight Tux's lil' helper
Joined: 17 Oct 2005 Posts: 80 Location: /dev/college
|
Posted: Mon Nov 06, 2006 8:11 pm Post subject: |
|
|
I have 2x 250 GB's and an 80GB, configged this way:
First 250, first partition: /boot
First 250, second partition: /
(The first 250 is going bad)
Second 250, first partition: swap
Second 250, second partition: /home
80 GB, only partition: /var
As far as I can see, tar is my only option, and these are the only hd's I have.
Suggestions for tar?
*edit* How to I copy and retain permissions? _________________ There are 10 kinds of people in the world: People who understand binary and those that don't.
Feel free to IM me to discuss anything as opposed to posting. |
|
Back to top |
|
|
nixnut Bodhisattva
Joined: 09 Apr 2004 Posts: 10974 Location: the dutch mountains
|
Posted: Tue Nov 07, 2006 5:35 pm Post subject: |
|
|
Moved from Installing Gentoo to Other Things Gentoo.
Not about getting gentoo installed. _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
talk is cheap. supply exceeds demand |
|
Back to top |
|
|
hulmeman Apprentice
Joined: 02 Jul 2002 Posts: 184 Location: Duchy of Lancaster, England.
|
Posted: Tue Nov 07, 2006 6:46 pm Post subject: |
|
|
Assuming you,ve got the space:
Code: | mount /boot
mkdir /home/home
mv /home/user1 /home/home/
mv /home/user2 /home/home/
mv /home/user3 /home/home/........etc (till /home only contains /home/home)
cp -a /boot /home
cp -a /bin /home
cp -a /dev /home
cp -a /etc /home
(cp -a /emul_linux_x86_usr_lib /home)
(cp -a /emul /home)
cp -a /lib /home
(cp -a /lib64 /home)
(cp -a /lib32 /home)
cp -a /media /home
cp -a /opt /home
cp -a /root /home
cp -a /sbin /home
cp -a /sys /home (not necessary...but)
cp -a /tmp /home
cp -a /usr /home
|
Then alter your fstab and grub.conf to mount / and /var on second drive, delete fstab entries for /home and /boot (they will now be on /), reboot and you're done!
<edit> I forgot, chroot into new system before you reboot, and re-run grub!
Code: | chroot /home
env-update && source /etc/profile
grub |
|
|
Back to top |
|
|
|