New Question about LVM/RAID

Crusty

Lifer
Sep 30, 2001
12,684
2
81
/commence thread recycling

I have 2 matched 40gb and 2 matched 100gb drives. Would it be possible to setup one 40gb + 100gb in LVM and likewise with the other 2 and then raid 1 the two of them together? Or should I just stick with 2 raid 1 arrays. All this will be with software RAID 1.


--------------old-------------

Well I fixed, I took all of my IDE drives out... all 4 of them. Reinstalled Debian on my SCSI drive. Rebooted, and it worked. Upgraded my kernel to a SMP one, installed all of server packages and copied my config files back over. Everything is fine and dandy.

I was trying to move my install from a 40gb IDE drive to a 9gb SCSI drive so I can free that drive up for data storage.

Here is what I did, after booting up into knoppix off a cd.

1) Created new partitions and created the filesystems.
2) mount /dev/hda1 /mnt/old
3) mount /dev/sda1 /mnt/new
4) cd /mnt/old
5) cp --archive ./ /mnt/new
6) chroot /mnt/new /bin/bash
7) edited lilo to change from hda to sda
8) Re-ran lilo, and rebooted

Now when it boots I get "Invalid Partition Table" and that's it. It doesn't even appear that lilo is loading. This leaves my system completely unbootable, except for cd/floppy.

Any ideas of what might be the problem?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
The same as before

There are two partitions on the disk

sda1 is mounted on / with ext3 filesystem and a file system id of 83. It is also set to bootable
sda2 is my swap partition with a file system id of 82.
 

Hyperblaze

Lifer
May 31, 2001
10,027
1
81
oh...now i remember....

you need to do something extra to install lilo on the master boot record.

there is a dd command.

i just haven't done it in forever. so can't really remember.

dd if=/<something or other> of=/<something or other> bs=512

i guess i've been spoiled with grub.

edit: i think it might be something like dd if=/dev/hda of=/<something> bs=512
not positive though.

edit2: gotta love google

dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
No you don't have to do that with lilo.

My lilo config is perfect, set to install on the MBR of sda and has the correct entries.

There is either something wrong with the HDD, or chrooting and installing lilo doesn't work. Although I have done it numerous times before.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Could be an issue with the BIOS and LILO disagreeing about the disk numbering. Those tend to crop up when you mix IDE and SCSI drives in the same system and can be fixed with the bios= tag. Check out the lilo.conf man page for details.

Or it could be something else - I'm kind of tired at the moment. But, yeah... mixed IDE/SCSI can cause problems there if the system wasn't set up for it before.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: Hyperblaze
oh...now i remember....

you need to do something extra to install lilo on the master boot record.

there is a dd command.

i just haven't done it in forever. so can't really remember.

dd if=/<something or other> of=/<something or other> bs=512

i guess i've been spoiled with grub.

edit: i think it might be something like dd if=/dev/hda of=/<something> bs=512
not positive though.

edit2: gotta love google

dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1

That would work if I didn't want to re-run lilo.

But by re-running lilo it installs to the MBR of the scsi drive just fine so that would only write the MBR of my ide drive to the scsi drive which would only cause problems.

 

imported_kseskisator

Junior Member
Mar 18, 2005
5
0
0
If LILO gets loaded and has a problem, it does things. It sometimes just prints just 'LI' or 'LIL' on the console. Frequently, it prints things like 'LILO 99 99 99 99 99 99...' and stops.

Yours does nothing of the sort. Two things are possible:
1) LILO does not get installed on the /dev/sda MBR in the first place. for whatever reason. Try to boot form the IDE disk. change the /etc/lilo.conf accordingly and run it from that setup, not from knoppix.
2) Your BIOS setup is not setup correctly, and the SCSI disk never gets the chance to boot in the first place. I don't think I can help you with that, since it's not a Linux problem.

Upgrading Lilo woundn't hurt, either. What distro are you running btw?
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
The distro is Debian, and as far as I can tell the BIOS is setup correctly, and the BIOS for the SCSI controller is setup correctly as well.

I will try to boot from the IDE disk and run lilo from there, as well as disconnecting the IDE drive and report back.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Same thing... i'm beginning to think that there is something wrong with the drive...

So I wrote zero's to the whole drive using dd. Then using fdisk wrote a new empty partition table to it, rebooted just to be sure. Recreated my partitions, rebooted just to be sure. Copied everything back over, booted up with the ide drive, then reconfigured lilo and ran it. It gave me two errors.

/dev/sda is not on the first disk
Boot sector is on different partition then map file.

:(
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: MCrusty
/dev/sda is not on the first disk
Boot sector is on different partition then map file.
Yup, looks like a disk labelling problem. Try this in the global section of lilo.conf

disk=/dev/sda
bios=0x80
disk=/dev/hda
bios=0x81


That works for me, but I'm not certain it's right for your system. Again, see man lilo.conf for gory details.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Now how on earth do i guess what order my BIOS assigns the discs...

From what I read, after version 22.4 or was it 5 that specifying disk=/ and bios= isn't necessary because of the way LILO lables the discs.

It also says that I can force LILO to use the disk=/ and bios labeling... but I need to find out what order my BIOS assigns the disks :(

This is frustrating.
 

imported_kseskisator

Junior Member
Mar 18, 2005
5
0
0
MCrusty:

I am using Debian as you (testing btw). I have done this many times. Never with scsi disks, but I have done it with SATA (which works with the scsi subsystem, so it's the same). I really don't understand what is wrong with your installation.

However, here's another thing you can try: Find your debian Installation CDs and try to boot from them. If they offer a rescue mode (Debian woody installation disks have this), use it and specify the root partition. In the first screen of the installer, type rescue=/dev/sda1 or something. This will boot the debian installation kernel, but use your scsi disk as root partition. In order not mess things up in your installation, you could also boot directly to single user mode: rescue=/dev/sda1 single

Hope that helps...
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: kseskisator
MCrusty:

I am using Debian as you (testing btw). I have done this many times. Never with scsi disks, but I have done it with SATA (which works with the scsi subsystem, so it's the same). I really don't understand what is wrong with your installation.

However, here's another thing you can try: Find your debian Installation CDs and try to boot from them. If they offer a rescue mode (Debian woody installation disks have this), use it and specify the root partition. In the first screen of the installer, type rescue=/dev/sda1 or something. This will boot the debian installation kernel, but use your scsi disk as root partition. In order not mess things up in your installation, you could also boot directly to single user mode: rescue=/dev/sda1 single

Hope that helps...

That problem is now fixed, and everything is working great as far as operating systems. Now that I have time today, I need to convert my ide disks to RAID/LVM.

Thanks Monoman for those links. :)
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
One more quick question, I have data on one of my 100gb drives that I would like to not lose. It won't be a big deal if I do, just a pain to pull all my backups for 90gb of data :(.

If I setup the raid 1 with:

raiddev /dev/md0
raid-level 1
nr-raid-disks 2
nr-spare-disks 0
persistent-superblock 1
device /dev/hde1
raid-disk 0
device /dev/hdg1
raid-disk 1

Where hde1 contains all my data will I lose everything?