Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Re-partitioning Help
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
mroconnor
Guru
Guru


Joined: 24 Feb 2006
Posts: 402
Location: USA

PostPosted: Thu Jan 29, 2009 4:34 am    Post subject: Re-partitioning Help Reply with quote

I need to merge two partitions into one. What concerns me most is making sure I archive the partitions correctly and extract them back correctly.

I will be merging /var and /usr/portage into one larger ext4 /var partition. I want to tar up /var using lzma compression but I am not sure how to do best to capture permissions/attributes and the restore them with all the correct ownership/permissions/attributes.

Once I get the backup/restore procedure correct, I can handle the rest - I think. ;)

Thanks in advance for any help.
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Thu Jan 29, 2009 7:31 am    Post subject: Reply with quote

Code:

mkdir /mnt/backup
mount -o bind /var /mnt/backup
cd /mnt/backup
tar cvjpf <filename>.tar.bz2 *

This writes all contents of the partition to a bzip2 compressed tar archive.

to untar use
Code:
tar xvjpf <filename>.tar.bz2


The interesting part is the p option, which does the preserving.
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
mroconnor
Guru
Guru


Joined: 24 Feb 2006
Posts: 402
Location: USA

PostPosted: Thu Jan 29, 2009 2:32 pm    Post subject: Reply with quote

Thanks @fangorn!

Just curious, why bind /var to the backup dir instead of just tarring /var itself?
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Thu Jan 29, 2009 3:28 pm    Post subject: Reply with quote

Just a bad habbit of mine :twisted:

That way you could be sure some runtime generated parts are not backed up. For instance when backing up / you would not get the contents of /dev /sys /proc (and any mounted filesystem by the way)
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
mroconnor
Guru
Guru


Joined: 24 Feb 2006
Posts: 402
Location: USA

PostPosted: Thu Jan 29, 2009 3:58 pm    Post subject: Reply with quote

I actually I like it, thanks again for the help.
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