Page 1 of 1

Combine two seperate partitions

Posted: Tue Jan 27, 2009 7:02 pm
by mroconnor
I think FSarchiver can do this but I am not sure how:

I need to combine /dev/sda6 & /dev/sda7 together using qtparted.

I assume I would combine the two partitions into one archive and the blast the partitions away and recreate them the extract the archive to that new partition.

Does that sound right?

Posted: Tue Jan 27, 2009 7:49 pm
by admin
You want to merge your partitions ?

You can use fsarchiver to save the contents of the two partitions. Be careful, it's still in development so there may be bugs.

1. mount /dev/xxx /mnt/part1 -r
2. mount /dev/yyy /mnt/part2 -r
3. fsarchiver savedir /backup/data.fsa /mnt/part1 /mnt/part2 -v
4. umount /mnt/part1 /mnt/part2
5. destroy /dev/xxx and /dev/yyy and create /dev/zzz
6. mount /dev/zzz /mnt/partz
7. fsarchiver restdir /backup/data.fsa /mnt/partz -v

Posted: Tue Jan 27, 2009 8:30 pm
by mroconnor
would it be best to do it from unmounted partitions or read only partitions? Also why would I use the savedir option over the savefs option?

Posted: Tue Jan 27, 2009 8:52 pm
by admin
With savedir you cannot use umounted partitions. So you have to mount it read-only.

The difference is that savefs saves all the files of a filesystem and its attributes, and savedir just considers files as tar. If you use savefs there, you can only restore one of the two partitions to the new bigger partition (one to one). You can to save the contents of these two filesystems...

Posted: Tue Jan 27, 2009 8:58 pm
by mroconnor
So then savedir is the way to go if I have to save the contents of /var 12GB and /usr/portage 6GB (gentoo based system) to the combined new 18GB partition. Does that mean I'll loose permissions and such?

Posted: Tue Jan 27, 2009 9:28 pm
by admin
fsarchiver is supposed to preserve all the files attributes, even the extended attributes, but there can be bugs. You can try to restore to a temp partition first if you want to be sure that it will work. Or you can try with just two small directories that you extract in a temp directory.

Posted: Wed Jan 28, 2009 5:12 pm
by mroconnor
I tried this as a test:

Code: Select all

[email protected] /root % mkdir /mnt/gentoo/var
[email protected] /root % mount /dev/sda7 /mnt/gentoo/var -r
[email protected] /root % fsarchiver -j 2 -z 9 savedir /mnt/gentoo/home/backup.fsa /mnt/gentoo/var 
I then mount a 2.5GB /tmp dir and ran this command:

Code: Select all

[email protected] /root % mount /dev/sda9 /mnt/gentoo/tmp 
[email protected] /root % fsarchiver restdir /mnt/gentoo/home/backup.fsa /mnt/gentoo/tmp -v 
It restored two dirs so far and has I assume stopped doing anything at all. What have a messed up?

Posted: Wed Jan 28, 2009 7:02 pm
by admin
I don't see what you mean, could you give more details ? You can add multiple verbose options (-vvvv) to have more details about that happens.

Posted: Wed Jan 28, 2009 9:07 pm
by mroconnor
Well when I did it fsarchiver just stopped doing anything at all. It was not listed as a running process or anything. I would trying it again but for some reason it messed up my /tmp and I can now longer write to it as a normal user only root.

Once I fix that I test it again.