Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Backup of disk on remote server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
rado3105
Apprentice
Apprentice


Joined: 14 Jul 2007
Posts: 293

PostPosted: Sat Dec 25, 2010 7:25 pm    Post subject: Backup of disk on remote server Reply with quote

It can be done mounting partition as ro, using this command:
dd if=/dev/sda | ssh root@target "(cat >/root/backup.img)"

where /dev/sda is disk on server, target is ip of pc I am trying to do the download from.

Everything works fine, but when I do the backup using that command it makes the backup image of size of hardisk(32gb), but only 4gb are with data. So is any way to backup just that data(something similar to acronis true image)?
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Sat Dec 25, 2010 7:58 pm    Post subject: Reply with quote

If you only want the data, use rsync.
Back to top
View user's profile Send private message
rado3105
Apprentice
Apprentice


Joined: 14 Jul 2007
Posts: 293

PostPosted: Sat Dec 25, 2010 8:15 pm    Post subject: Reply with quote

So its something like copy tool, copies folder. How to restore than server, is possible to copy back that data on running server?(sometimes when I make some experimentation I want to revert back, and I dont want everytime physically do it). Is that possible?
Back to top
View user's profile Send private message
rado3105
Apprentice
Apprentice


Joined: 14 Jul 2007
Posts: 293

PostPosted: Wed Dec 29, 2010 9:15 am    Post subject: Reply with quote

Nobody can help?
Back to top
View user's profile Send private message
HensonDuglasSturgill
n00b
n00b


Joined: 24 Dec 2010
Posts: 4
Location: Canton, NC, USA

PostPosted: Sun Jan 09, 2011 8:16 am    Post subject: Reply with quote

So, I've never actually done this, but I was thinking something like the following command -- assuming you're booted into the Gentoo install CD and have your root (and /boot mounted):

tar -cvj -C /mnt/gentoo --exclude proc --exclude dev --exclude lost+found > /mnt/external/backup.tar.bz2

You'd still need make directories for /dev and /proc when you try to restore, and probably need to run MAKEDEV.
Back to top
View user's profile Send private message
ppurka
Advocate
Advocate


Joined: 26 Dec 2004
Posts: 3256

PostPosted: Sun Jan 09, 2011 1:05 pm    Post subject: Reply with quote

If you are uncomfortable with configuring rsync, then you can use a GUI for rsync like luckybackup.
_________________
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Back to top
View user's profile Send private message
bobspencer123
Guru
Guru


Joined: 19 Dec 2005
Posts: 544

PostPosted: Sun Jan 09, 2011 6:23 pm    Post subject: Reply with quote

you could check out stage 4 script created by blinkeye.
_________________
Increasingly becoming a 2 channel audio nut!
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23103

PostPosted: Sun Jan 09, 2011 8:30 pm    Post subject: Reply with quote

HensonDuglasSturgill wrote:
So, I've never actually done this, but I was thinking something like the following command -- assuming you're booted into the Gentoo install CD and have your root (and /boot mounted):

tar -cvj -C /mnt/gentoo --exclude proc --exclude dev --exclude lost+found > /mnt/external/backup.tar.bz2

You'd still need make directories for /dev and /proc when you try to restore, and probably need to run MAKEDEV.
Assuming use of the LiveCD, then there is no need to exclude proc and dev. They are mount points for virtual filesystems, so the on-disk instances directories will not be special when you are in the CD environment.
Back to top
View user's profile Send private message
TJNII
l33t
l33t


Joined: 09 Nov 2003
Posts: 648
Location: for(;;);

PostPosted: Sun Jan 09, 2011 8:36 pm    Post subject: Reply with quote

Hu wrote:
Assuming use of the LiveCD, then there is no need to exclude proc and dev. They are mount points for virtual filesystems, so the on-disk instances directories will not be special when you are in the CD environment.


You'll want to exclude proc and sys, otherwise you start picking up things like kernel memory that really bloat your backup. You can exclude dev if you know what you're doing, but you will need to populate /dev with some files when reassembling the backup if omitted. I usually use the --one-file-system option with tar and point it at / to exclude dev, proc, sys, NFS mounts, and anything else not on my root disk.
Back to top
View user's profile Send private message
molot
Apprentice
Apprentice


Joined: 26 Feb 2005
Posts: 214
Location: Warsaw, Poland

PostPosted: Sun Jan 09, 2011 9:07 pm    Post subject: Reply with quote

TJNII wrote:
You'll want to exclude proc and sys, otherwise you start picking up things like kernel memory that really bloat your backup.
Unless, like Hu wrote, computer is running livecd gentoo, and we're backing up the hdd instance. Then proc in context of a backup will have nothing to do with livecd's proc. If any normal files ended there, it might be good to know about them. And backup of a partition that have live, up and running OS on it is hardly ever good idea. Individual directories - yes, but not whole tree.
_________________
"I just have to run faster than the slowest party member"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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