View previous topic :: View next topic |
Author |
Message |
Randomlynessive n00b
Joined: 29 Jul 2007 Posts: 6
|
Posted: Sun Jul 29, 2007 8:14 am Post subject: Backing up gentoo |
|
|
is there any easy way to back up gentoo? like, putting your entire installation into a massive tarball? and if so, how would i go about doint it? (btw, im pretty new to gentoo and linux/UNIX in general, so try to explain it in the simplest terms possible, thanks) |
|
Back to top |
|
|
likewhoa l33t
Joined: 04 Oct 2006 Posts: 778 Location: Brooklyn, New York
|
Posted: Sun Jul 29, 2007 8:21 am Post subject: |
|
|
there are plenty of guides that show how to accomplish this, my way is to simply use tar. here is how.
Code: |
cd /
tar cvjp --exclude=sys --exclude=proc --exclude=dev --exclude=stage4.tar.bz2 --file stage4.tar.bz2 /
|
then simply, untar it from the livecd and before you are about to Code: | mount -o bind /dev /mnt/gentoo/dev |
type this. Code: | cd /mnt/gentoo/dev;MAKEDEV generic | . this should be all you need to do to restore from a
backup. |
|
Back to top |
|
|
col l33t
Joined: 08 May 2002 Posts: 820 Location: Melbourne - Australia
|
Posted: Sun Jul 29, 2007 8:29 am Post subject: |
|
|
A simple backup of the root partition is:
cp -ax / /mnt/backup |
|
Back to top |
|
|
Randomlynessive n00b
Joined: 29 Jul 2007 Posts: 6
|
Posted: Sun Jul 29, 2007 8:40 am Post subject: |
|
|
likewhoa wrote: | there are plenty of guides that show how to accomplish this, my way is to simply use tar. here is how.
Code: |
cd /
tar cvjp --exclude=sys --exclude=proc --exclude=dev --exclude=stage4.tar.bz2 --file stage4.tar.bz2 /
|
then simply, untar it from the livecd and before you are about to Code: | mount -o bind /dev /mnt/gentoo/dev |
type this. Code: | cd /mnt/gentoo/dev;MAKEDEV generic | . this should be all you need to do to restore from a
backup. |
so it works something like this: put everything in a tarball (called stage4) except the sys, proc and dev folders
then, when i load up the live cd, i just mount everything and extract everything to "/"
although, i dont understand the purpose of Code: | cd /mnt/gentoo/dev;MAKEDEV generic | and i also dont understand why to exclude sys and proc, and to an extent dev (i have a reason in my head, but im not sure if its right)
thanks for the help, but i like to know _why_ i do things, rather than just remembering lines of code to input |
|
Back to top |
|
|
likewhoa l33t
Joined: 04 Oct 2006 Posts: 778 Location: Brooklyn, New York
|
Posted: Sun Jul 29, 2007 9:05 am Post subject: |
|
|
col wrote: | A simple backup of the root partition is:
cp -ax / /mnt/backup |
it would be a waste of time to copy absolutely everything. /proc,/sys/, & /dev are all generated automatically by the kernel and or udev for /dev.
Randomlynessive wrote: | although, i dont understand the purpose of
likewhoa wrote: | Code: |
cd /mnt/gentoo/dev;MAKEDEV generic |
|
|
this step is needed since, you didn't tar up your /dev directory and MAKEDEV generic will create generic nodes that will be part of the initial /dev tree so that your system can successfully boot.
Randomlynessive wrote: | and i also dont understand why to exclude sys and proc, and to an extent dev (i have a reason in my head, but im not sure if its right) |
/proc is generated by the kernel when mounted by the system. /sys is also generated for you, and /dev is handled by udev.
Hope this explains it better for you. more links..
http://en.wikipedia.org/wiki/Procfs#Linux - info on PROCFS
http://en.wikipedia.org/wiki/Sysfs - info on SYSFS
http://en.wikipedia.org/wiki/Udev - info on UDEV
Last edited by likewhoa on Sun Jul 29, 2007 9:38 am; edited 2 times in total |
|
Back to top |
|
|
Randomlynessive n00b
Joined: 29 Jul 2007 Posts: 6
|
Posted: Sun Jul 29, 2007 9:31 am Post subject: |
|
|
thanks likewhoa, you have been a great help
and to a lesser extent col, thanks for your contribution |
|
Back to top |
|
|
attenpeter n00b
Joined: 25 Nov 2006 Posts: 33
|
|
Back to top |
|
|
col l33t
Joined: 08 May 2002 Posts: 820 Location: Melbourne - Australia
|
Posted: Sun Jul 29, 2007 10:13 pm Post subject: |
|
|
likewhoa wrote: | col wrote: | A simple backup of the root partition is:
cp -ax / /mnt/backup |
it would be a waste of time to copy absolutely everything. /proc,/sys/, & /dev are all generated automatically by the kernel and or udev for /dev.
|
Read the man page. None this will have its archive bit set so will not copy when -a is being used. |
|
Back to top |
|
|
likewhoa l33t
Joined: 04 Oct 2006 Posts: 778 Location: Brooklyn, New York
|
Posted: Mon Jul 30, 2007 5:38 am Post subject: |
|
|
col wrote: | likewhoa wrote: | col wrote: | A simple backup of the root partition is:
cp -ax / /mnt/backup |
it would be a waste of time to copy absolutely everything. /proc,/sys/, & /dev are all generated automatically by the kernel and or udev for /dev.
|
Read the man page. None this will have its archive bit set so will not copy when -a is being used. |
I do RTFM FYI!
-x doesn't skip mount point directories so /proc,/sys, & /dev would be copied. |
|
Back to top |
|
|
|