LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   removing dual-boot & moving Gentoo partitions (https://www.linuxquestions.org/questions/gentoo-87/removing-dual-boot-and-moving-gentoo-partitions-734198/)

_ian 06-19-2009 10:16 AM

removing dual-boot & moving Gentoo partitions
 
Hi

Does anyone know an easy way to move Gentoo partion(s) to the start of my disk because I now want to remove the Vista partition from my dual boot laptop and I'd like to somehow move the gentoo partitions to the start of the disk without reinstalling if possible.

I have a laptop with the following disk partitions;

Device Boot Start End Blocks Id System
/dev/sda1 * 1 10444 83886080 7 HPFS/NTFS Vista
/dev/sda2 * 10444 10456 100716 83 Linux
/dev/sda3 10457 11065 4891792+ 82 Linux swap
/dev/sda4 11066 30401 155316420 5 Extended
/dev/sda5 11066 17145 48837568+ 83 Linux
/dev/sda6 17146 30401 106478788+ c W95 FAT32 (LBA)


I thought that maybe copying the root partition using DD to the Vista partition, but not sure if this would damage the MBR?

Does anybody now an easy/safe way of doing this or am I better off just formating the partition, removing Vista from the Grub menu and using it as a data partition?

Thanks.

NeddySeagoon 06-19-2009 10:51 AM

_ian,

Tell us how your Linux partitions are used now.

dd is a bad idea because it copies all the underlying filesystem metadata, so if you copy a small partition onto a bigger partition the extra space appears to have vanished. Copying a bigger parttion to a smaller one .. don't ever do that as some the bigger partition will be left behind.

You should copy files from one parttion to the other but boot with a CD, so your normal gentoo root filesystem is not live. This avoids the complications with copying /dev /sys and /proc, which are not real filesystems.

Book your CD, mount the donor partition to /mnt/gentoo.
Mount the copy to /mnt/floppy (any mount point will do as long as its not inside /mnt/gentoo)
Now use the
Code:

cp -a /mnt/gentoo/ /mnt/floppy/
to do the copy. Read
Code:

man cp
while it runs.
If your want to be able to boot the copy, your will need to edit /etc/fstab (in the copy) and grub.conf as your (real_)root=/dev/... will have changed and possibly your root (hd... too.

The MBR does not belong to any filesystem or partition, so operations on partitions or their filesystems will not harm the MBR.

_ian 06-22-2009 06:50 AM

Hi, thanks for your reply.

I would like to end up using the partitions like below;

/dev/sda1 80 Gb Linux /root
/dev/sda2 100 Mb Linux /boot
/dev/sda3 5 Gb Linux /swap
/dev/sda4 150 Gb Linux /home & data

So I have removed the Vista partition, moved the Linux root into it's place at front of drive, kept the /boot & /swap where they are and deleted and removed the extended partitions & created one large /home & data partition (Probably formated as ext3).

Is it best to have the linux /boot partition first or does this not matter? Can I have the /root partitin at that start of the disk? If I had to move this I might as well rebuild from scratch - which I can do, I was just trying to make life easy for myself!

Does this sound possible with the solution you suggested "cp -a" from a live CD, then changing the fstab?

Thanks for your help

_ian

i92guboj 06-22-2009 07:41 AM

Quote:

Originally Posted by _ian (Post 3582184)
Hi, thanks for your reply.

I would like to end up using the partitions like below;

/dev/sda1 80 Gb Linux /root

I guess you meant /, not /root (which would be the home for the root user.

Quote:

Is it best to have the linux /boot partition first or does this not matter? Can I have the /root partitin at that start of the disk? If I had to move this I might as well rebuild from scratch - which I can do, I was just trying to make life easy for myself!
Nowadays you shouldn't have any problem with that.

Quote:

Does this sound possible with the solution you suggested "cp -a" from a live CD, then changing the fstab?

Thanks for your help

_ian
cp -a and then correcting your grub.conf and fstab should be all you need.

_ian 06-22-2009 09:26 AM

Hi i92guboj

Thanks - I shall backup and re-configure this way then and yes I did mean '/' & not '/root'.


Cheers

NeddySeagoon 06-23-2009 12:09 PM

_ian,

A separate boot partition is only needed when the BIOS cannot read all of the hard drive. This normally only happens when you put a large drive in an old PC. The requirement is to have the files needed for booting in the area that the BIOS can read.
The terms 'large' and 'old' are relative. The BIOS not reading the entire drive was first a problem when drives reached 528Mb.

The other reason for a separate /boot is that you have several distros installed. Then /boot can be shared


All times are GMT -5. The time now is 03:06 PM.