View previous topic :: View next topic |
Author |
Message |
mroconnor Guru
Joined: 24 Feb 2006 Posts: 402 Location: USA
|
Posted: Thu Jan 29, 2009 4:34 am Post subject: Re-partitioning Help |
|
|
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 |
|
|
fangorn Veteran
Joined: 31 Jul 2004 Posts: 1886
|
Posted: Thu Jan 29, 2009 7:31 am Post subject: |
|
|
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 |
|
|
mroconnor Guru
Joined: 24 Feb 2006 Posts: 402 Location: USA
|
Posted: Thu Jan 29, 2009 2:32 pm Post subject: |
|
|
Thanks @fangorn!
Just curious, why bind /var to the backup dir instead of just tarring /var itself? |
|
Back to top |
|
|
fangorn Veteran
Joined: 31 Jul 2004 Posts: 1886
|
Posted: Thu Jan 29, 2009 3:28 pm Post subject: |
|
|
Just a bad habbit of mine
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 |
|
|
mroconnor Guru
Joined: 24 Feb 2006 Posts: 402 Location: USA
|
Posted: Thu Jan 29, 2009 3:58 pm Post subject: |
|
|
I actually I like it, thanks again for the help. |
|
Back to top |
|
|
|