Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

My partitions are:

  • Ubuntu's / on /dev/sda1
  • Ubuntu's /home on /dev/sda6/
  • Crunchbang's / on dev/sda7

Now I want to install Backtrack, but for this I need to get rid of Ubuntu's /home and move its content somewhere else (whichever of the other partitions).

How should I go about and do that without messing up the partitions table and the boot loader?

Partitions table

share|improve this question
    
Related: unix.stackexchange.com/questions/5113/… –  slm Aug 8 '13 at 0:55
    
Related: unix.stackexchange.com/questions/17782/… –  slm Aug 8 '13 at 0:56
add comment

2 Answers

up vote 1 down vote accepted

I think it should be safe to resize /dev/sda6 without losing any data. You can do the following:

  • First of all, to be sure, keep a backup (the contents of /dev/sda6 fit in /dev/sda1)
  • Shrink /dev/sda6 (right click, then resize/move - I think it is better to shrink moving the right arrow). This will leave some unallocated space.
  • Right click on the unallocated space and create a new partition there. Move the arrows to fill the whole space.
  • Hit apply

Then you can install backtrack on the partition you created from the unallocated space. The partitions table doesn't get messed up, it gets automatically updated by gparted with no problems. As for the bootloader, if you are using GRUB you may use 'update-grub' from an Ubuntu terminal after installing backtrack so it is included in the boot menu.

Very important note: While on the backtrack installation, the installer will ask you to install GRUB. Do not! I think there is a checkbox somewhere at the end of the installation that allows you to skip installing GRUB. Just reboot as the installer prompts you, boot Ubuntu and run 'update-grub'.

share|improve this answer
    
Thank you, perfect solution, I now have a nicely triple-booting netbook ! :) –  anas Aug 10 '13 at 20:42
add comment

I don't know why you should remove the /home partition, but I'm sure that copying the contents of the /dev/sda6 to the Ubuntu's / in the home directory and deleting the entry of the fstab file on Ubuntu, should suffice.

Using live CD (or whatever you got at hand that allows you mount and cp) lets copy your files:

sudo mkdir /mnt/ubunturoot
sudo mkdir /mnt/ubuntuhome
sudo mount /dev/sda1 /mnt/ubunturoot
sudo mount /dev/sda6 /mnt/ubuntuhome

Ok, now lets check we got the files:

ls /mnt/ubuntuhome
anas lost+found

All good, lets continue (you should be aware that in Ubuntu's root you should have more free space that you have occupied on /home):

sudo mkdir /mnt/ubunturoot/home
sudo cp -PR /mnt/ubuntuhome/* /mnt/ubunturoot/home/

Wait a long time... lets verify that everything's there:

ls -lR /mnt/ubuntu/home > newhome
ls -lR /mnt/ubuntuhome > oldhome
comm -23 <(sort newhome) <(sort oldhome) ## this can be done however you like

Now edit the fstab file and comment out the /home entry:

sudo nano /mnt/ubunturoot/etc/fstab

Reboot, check everything's an OK, and now you can delete your partition however you like.

share|improve this answer
    
Just to add some info: you can also do a mount-rebind for / , e.g., sudo mount -o bind,rw / /mnt/ubunturoot and directly copy /home without having to boot using a LiveCD –  pepoluan Aug 8 '13 at 3:07
    
Thanks for your answer! To clarify: 1- This process can be done using any LiveCD (Debian-based) ? 2- Will I be able to install a new OS on that partition and boot on it using Grub ? –  anas Aug 8 '13 at 11:09
    
@anas 1- yes 2- I don't see why not. –  Braiam Aug 8 '13 at 13:50
    
@Braiam Ok, thank you. I will try it from Crunchbang (installed on /dev/sda7/), is that fine ? –  anas Aug 8 '13 at 14:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.