Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Backup gentoo OS while in operation?
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
mansniks
Apprentice
Apprentice


Joined: 19 Nov 2007
Posts: 290

PostPosted: Mon Mar 10, 2008 7:50 pm    Post subject: Backup gentoo OS while in operation? Reply with quote

Hello,
is it possible to create backup of all OS files while it is running (backups itself)? How?
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Mon Mar 10, 2008 8:00 pm    Post subject: Reply with quote

Yeah, mount your second drive, stop non essential serves, especially database related things, anything that might modify the disk by itself.

If / is all one file system
cp -a --one-file-system / /mnt/second_drive
This wont be bootable with out a grub install and the device files

edit: this method assumes somethings, but I'm assuming you'll come back with questions and idiosyncracies
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
mansniks
Apprentice
Apprentice


Joined: 19 Nov 2007
Posts: 290

PostPosted: Mon Mar 10, 2008 8:14 pm    Post subject: Reply with quote

Ok, I can type 'man cp' myself. Just tell me what is "idiosyncracies"?

But... There is one important question - how about all special files (devices etc)? I need full copy. Grub is not a problem.
So is there a way or I better turn off OS (sure, I don't like it)?
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Mon Mar 10, 2008 8:25 pm    Post subject: Reply with quote

I said idiosyncrasies, because I don't know what your exact setup is. If you have multiple partitions, then you'ld have to do it for each one, which is not hard in a script. the -x flag avoids the problems of cp trying to copy /proc /sys and /dev ( I forget which is the problem)

You asked this question as it was a backup (something you would do often), implying you would only need things like /dev if you had a system failure (rare), in which case I might have a boot disk handy, or boot and then deal with the pesky issue file. Which means you type in the root password, mount -bind /dev (the issue file tells you EXATLY what to do), and reboot. But as this only happens when I have a REAL problem, it doesn't bother me. I guess if you were trying to reduce down time to <5min...
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Mon Mar 10, 2008 8:29 pm    Post subject: Reply with quote

I'm referencing this:
I guess you could deal with it ahead of time, you'ld only need to do it once

Quote:
-----------------------------------------------------
Your system seems to be missing critical device files
in /dev ! Although you may be running udev or devfs,
the root partition is missing these required files !

To rectify this situation, please do the following:
mkdir /mnt/fixit
mount --bind / /mnt/fixit
cp -a /dev/* /mnt/fixit/dev/
umount /mnt/fixit
rmdir /mnt/fixit

You may refer to these instructions at /etc/issue.
If you previously had an issue file, it has been
backed up at /etc/issue.devfix. Once you've fixed
your system, you will have to restore your old issue
file in order to get rid of this warning.

Thanks for using Gentoo ! :)
https://bugs.gentoo.org/show_bug.cgi?id=40987
-----------------------------------------------------

_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Mon Mar 10, 2008 8:34 pm    Post subject: Reply with quote

IIRC, It would probably be enough to do this:

Code:
mknod /mnt/backup/dev/console c 5 1
mknod /mnt/backup/dev/null    c 1 3
mknod /mnt/backup/dev/zero    c 1 5


but don't take my word for it
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
mansniks
Apprentice
Apprentice


Joined: 19 Nov 2007
Posts: 290

PostPosted: Mon Mar 10, 2008 8:54 pm    Post subject: Reply with quote

Omitting /sys and /proc is not a problem?
Back to top
View user's profile Send private message
coolsnowmen
Veteran
Veteran


Joined: 30 Jun 2004
Posts: 1479
Location: No.VA

PostPosted: Mon Mar 10, 2008 8:59 pm    Post subject: Reply with quote

not a problem, there are no files there anyways, they are virtual.
the /dev files are also to some degree, the only problem is, some are needed before udev has the chance to populate them...so you put them there ahead of time.

note: mount
/dev/sda1 on / type ext3 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
udev on /dev type tmpfs (rw,nosuid)
_________________
emerge: there are no ebuilds to satisfy "moo"
Back to top
View user's profile Send private message
mansniks
Apprentice
Apprentice


Joined: 19 Nov 2007
Posts: 290

PostPosted: Mon Mar 10, 2008 9:10 pm    Post subject: Reply with quote

Thank you! I see you answering me not first time. That makes me wonder how you find time! Gentoo is part of our life, right? :)
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