LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Moving partitions (https://www.linuxquestions.org/questions/linux-software-2/moving-partitions-4372/)

nabil 07-16-2001 04:48 PM

Moving partitions
 
Ok, Here is what I got

Disk /dev/hda: 255 heads, 63 sectors, 3328 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1216 9767488+ 83 Linux
/dev/hda2 1217 1234 144585 82 Linux swap
/dev/hda3 1235 3328 16820055 83 Linux


I have gotton 2 Linux Os's dual booted on 1 disk drive 2 partitions as shown above.
I currently have a lilo menu that comes up during boot and I select linux1 or linux2 to boot to either. I would like to remove Linux 1 and delete it's partition to utilize for more space on Linux 2...
Is there anything special I need to do before I destroy my hard work on my Linux2 system. BTW: Linux2 system is built completely from grounds up. I spent weeks make and installing files on that baby.

Notice my Linux2 system is installed on /dev/hda3 and that's the one I like to keep and delete linux1 on /dev/hda1.
What is scaring me is lilo and were it resides...

Thanks for any help.

nabil 07-16-2001 06:14 PM

Another thing is to move this partition to another one on a different system. I currently have Redhat 7.1 setup on 1 system with 2 disk drives running as Raid 1...So How can I move my Linux2 above to this Raind partition and makeRaid again....

jharris 07-16-2001 07:55 PM

LILO should be installed to you MBR so removing partitions shouldn't effect it directly. The thing that I'm uncertain about would be how the partitions are numbered. Will /dev/hda3 still be /dev/hda3 when /dev/hda1 has gone?? I can't say I've ever played with this, although I know you don't have to have consecutive partition numbers as my parallel port Zip drive sees its disks as /dev/sda4 and they've only got a single partition.

I think you'll have to be brave and just go for it!

As for moving to RAID - unless things have changed since I last played with it (quite a while ago) if you actually reuse the raid tools' mkraid then you'll blank the parition. You might be able to copy all the files to the RAID pair but I wouldn't bank on it too much. No matter how you go about it you'll have to play with LILO and your fstab files so they reflect the change in kernel location and file system location respectively.

cheers

Jamie...

mcleodnine 07-17-2001 01:20 AM

Moving onto RAID is actually retty straightforward, but you need to be comfortable with the following items and a spare disk is more or less required.

making a boot floppy OR getting REALLY good at getting LILO on the MBR of another disk.

shuffling partitions; I use
Code:

mount (empty partition, formatted) /mnt
cd /
find . -xdev | cpio -pm /mnt/

do the same for the /boot partition

get this new partition bootable and runnable as the LAST disk on the system (the first disks will be used for the RAID array)

configure and format the RAID array as per the howto

copy your filesystem to the RAID array as above.

read the Root RAID Howto!

Don't put anything else but the swap on the drives that use RAID. Multiple mount points alongside the RAID will hurt performance.

I use a lot of RAID-5 and the 'failed-disk' parameter works great as you can have your root filesystem on the first hard disk, mark it as failed in the array, build the array, copy stuff to the array, boot and run off said array (to confirm operation) and then repair the array (by adding the first drive back into the array).


brain hurts - gotta go.

nabil 07-17-2001 03:39 AM

Ok,
The Raid stuff all sound good, but for now I need to resolve the LILO issue,..I was thinking to do
* fdisk /dev/hda
* make /hda3 bootable
* delete hda1. Then go and adjust fstab and lilo.conf
..DOes this sound right ???Would my system boot after that ???
What about lilo residing on block under 1024 ??? or MBR of a disk, How can I ensure proper installation...

How about if I can just skip all that above and just tar my linux2 file system then move on to the other machine with Raid setup and start with what mcleodnine suggested...Can I just boot other system with generic boot disk, fdisk it anf go from there...Sorry guys I am not very familiar with these processes. I have always depended on Redhat to do all that for me and never had to do it manually like that.

jharris 07-17-2001 03:55 AM

Quote:

Originally posted by nabil
What about lilo residing on block under 1024 ??? or MBR of a disk, How can I ensure proper installation...
Its not LILO that goes beyond 1024, its when the kernel is beyond block 1024, so if you were booting from a kernel in this partition before then you must be OK - lilo will stay on your MBR and just read the kernel from the partition.

The tar option could be a winner but I'd think about using something like cpio as it'll store more of the details about your files so the restore should be a bit more sucessful.

cheers

Jamie...


All times are GMT -5. The time now is 10:09 AM.