LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Move boot partition/Backup (https://www.linuxquestions.org/questions/linux-general-1/move-boot-partition-backup-400805/)

hazmatt20 01-08-2006 03:59 AM

Move boot partition/Backup
 
So, my installation drive is a bit of a mess. I don't know what I did when I installed Fedora, but it's a mess now. Here's my partition table.

Device Boot Start End Blocks Id System
/dev/hda1 2 3824 30708247+ f W95 Ext'd (LBA)
/dev/hda5 2 1913 15358108+ 7 HPFS/NTFS
/dev/hda6 1914 1926 104391 83 Linux
/dev/hda7 1927 3824 15245653+ 8e Linux LVM

As you can see with hda1, the windows and linux partitions are bundled together in an extended partition (I think. Not real familiar with partitions outside of just primaries). Anyway, I've got windows up in vmware thanks to the new free player, so the ntfs partition is irrelevant. I also had another ntfs partition to use the remainder of the drive (250 GB total), but I deleted it to change to ext3. However, I want to redo the structure to maximize the free space, not to mention keep everything in order. I also changed my mind again and decided to put it all in the partition with fedora, which would be hda7 above. So, how would I go about doing this? Backup everything and reinstall? Remove all other partitions and resize? What should I do, and how would I do it? Thanks, guys.

pixellany 01-08-2006 10:03 AM

this partition table seems screwy. The extended partition should encompass the other (logical) partitions--eg how can /dev/hda5 start at 1913, if the extended partition starts at 3824?
Also, you have two Linux partitions, but neither is swap.

If I read you correctly, you want a Linux-only install, with Windows running under VMWare.....Start over: Set up with 3 primary partitions for /boot, swap, and / Leave a large chunk of the disk unpartitioned, so it will be easy to add stuff later without disturbing your existing setup.

hazmatt20 01-08-2006 01:52 PM

The table didn't line up correctly when I pasted it, so you are reading it wrong. Boot is an empty column, and the start number is under boot. The extended partition starts where the windows partition starts and ends where the linux LVM partition ends. If I started over, I know how to set it up correctly with boot, swap, and main, but if I do, I need to know how to backup everything so I don't have to go through redownloading and reinstalling everything. Is there a way to move and resize everything without having to start over?

saikee 01-08-2006 02:28 PM

I didn't find any problem with the partition table because hda5 starts from 2 and not 1913. The table is correct without any overlaps and dead spaces. Partitions are tightly following each other and should have no problem in operation.

The only screwy bit of it is the extended partition is at the start of the disk with 30Gb, leaving 220Gb space at the back.

To use the remaining space effectively needs a bit of skill because there can be further 3 primary paritions; hda2, hda3 and hda4. However if the partition hda2 is formed after hda7 then no more logical partition is possible.

Therefore the correct way to do it is to tell the partitioning program that hda2 should start from the end of the disk, so should be hda3 and hda4. Whatever space left is therefore a void after hda7 and hda4 so that additional logical partitions from hda8 to hda60 can be created.

I can't advise on vmware partitions as I haven't used them before. However in moving the Linux to another partition it will become unbootable and needed to be rescued. LVM is complicated in that it addresses the root of Fedora by a "Label" and not by the partition number. The Label is generated by the installer. Therefore I am not hopeful, otherwise it is only a matter to amend /boot/grub/menu.lst and /etc/fstab files after migration.

Thus my suggestion is to make may be hda2, hda3, and hda4 at the rear end of the disk to receieve hda5, hda6 and hda7.

The method to move them.

You need to partition hda5 exactly the same size as hda4 and the same partition type. Similarly for hda6 to match hda3 and then hda7 same size as hda2. Then these lines will mirror the 3 across
Code:

dd if=/dev/hda5 of=/dev/hda4 bs=32256
dd if=/dev/hda6 of=/dev/hda3 bs=32256
dd if=/dev/hda7 of=/dev/hda2 bs=32256

You can then proceed to make the hda2, 3 & 4 work while still have the original versions.

hazmatt20 01-08-2006 11:10 PM

VMware uses a virtual partition and doesn't actually partition the disk. Don't worry about it.

The whole point of moving the installation would be to move it to a larger partition that uses up all available space on that drive not just to get the partition table to line up in numerical order.

saikee 01-09-2006 02:16 AM

I doubt if you can do a resizing and moving partitions in the same disk within one step, especially with NTFS and LVM involved.


All times are GMT -5. The time now is 01:29 AM.