Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Backing up gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Randomlynessive
n00b
n00b


Joined: 29 Jul 2007
Posts: 6

PostPosted: Sun Jul 29, 2007 8:14 am    Post subject: Backing up gentoo Reply with quote

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
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 778
Location: Brooklyn, New York

PostPosted: Sun Jul 29, 2007 8:21 am    Post subject: Reply with quote

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
View user's profile Send private message
col
l33t
l33t


Joined: 08 May 2002
Posts: 820
Location: Melbourne - Australia

PostPosted: Sun Jul 29, 2007 8:29 am    Post subject: Reply with quote

A simple backup of the root partition is:

cp -ax / /mnt/backup
Back to top
View user's profile Send private message
Randomlynessive
n00b
n00b


Joined: 29 Jul 2007
Posts: 6

PostPosted: Sun Jul 29, 2007 8:40 am    Post subject: Reply with quote

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
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 778
Location: Brooklyn, New York

PostPosted: Sun Jul 29, 2007 9:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Randomlynessive
n00b
n00b


Joined: 29 Jul 2007
Posts: 6

PostPosted: Sun Jul 29, 2007 9:31 am    Post subject: Reply with quote

thanks likewhoa, you have been a great help
and to a lesser extent col, thanks for your contribution
Back to top
View user's profile Send private message
attenpeter
n00b
n00b


Joined: 25 Nov 2006
Posts: 33

PostPosted: Sun Jul 29, 2007 11:40 am    Post subject: Reply with quote

There also is a cute script which does the job (and a little more) for you automatically:

http://blinkeye.ch/mediawiki/index.php/GNU/Linux_System_Backup_Script_(stage4)

(im sorry, i can't get this link right... neither with [url][/url] tags nor without... I'm stupid....)
Back to top
View user's profile Send private message
col
l33t
l33t


Joined: 08 May 2002
Posts: 820
Location: Melbourne - Australia

PostPosted: Sun Jul 29, 2007 10:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 778
Location: Brooklyn, New York

PostPosted: Mon Jul 30, 2007 5:38 am    Post subject: Reply with quote

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! :D

-x doesn't skip mount point directories so /proc,/sys, & /dev would be copied.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum