automated installations (12)

I solved the problem.

Next to tracking where the bug appears, I set up a new virtual machine and duplicated everything the debian installer did when partitioning and mounting. That is: I created the same partitions, formatted ext3 and copied the /etc/fstab file.

I believe now that I know what the cause is. In my partitioning scheme, the first partition started at sector 1, while the debian installer makes it start at sector 63.
I've seen this behaviour before when I was looking at partman-auto.
I'm not sure what is inside those 63 sectors (the first track), but I'd love to find out.

This link explains that in the old days, the 62 sectors after the boot sector, were left unused so that each partition starts at cylinder boundary. I can't really believe that Linux has problems with this, but it might.

Here it is suggested that Linux has no alignment requirement at all.

So now I've tried creating a partition from sector 1: works, creating an ext2 partition instead of ext3: works, toggling bootable flag: works.

Next thing you'll tell me that I've been imagining this bug.

Goddamnit. Now I've repeated every step I took in the first attempt and it still works.
[Oh the irony, being pissed because something works]

The only thing I can think of now that could still be wrong is accidently trying to mount a ext2 filesystem as ext3: nothing !


this is what I do now:

echo -e ",,83" | sfdisk /dev/discs/disc0/disc
mke2fs /dev/discs/disc0/part1
mkdir /target
mount /dev/discs/disc0/part1 /target
mkdir /target/etc
nano /target/etc/fstab

proc /proc proc defaults 0 0
/dev/sda1 / ext2 defaults,errors=remount-ro 0 1

Well, so be it :)
Let's see if I can kick in some RAID.

echo -e ",1000,fd\n,1000,fd" | sfdisk -uM /dev/discs/disc0/disc
modprobe md
modprobe raid1
mdadm --create /dev/md/0 -l raid1 -n 2 /dev/discs/disc0/part1 /dev/discs/disc0/part2
mke2fs /dev/md/0
mkdir /target
mount /dev/md/0 /target
nano /target/etc/fstab

proc /proc proc defaults 0 0
/dev/md/0 / ext2 defaults,errors=remount-ro 0 1

Everything seems to work ok, except grub decided to be a bitch and not install itself.
That can be remedied :)

After grub complains a number of times (I think 2 of 3), it drops you into the main menu where you can select "continue without a bootloader"
Before doing that, grub needs to be setup though.

chroot /target /sbin/grub
device (hd0) /dev/sda
root (hd0,0)
setup (hd0)
chroot /target /sbin/grub-install /dev/sda
chroot /target /sbin/update-grub

update-grub would not generate /boot/grub/menu.lst because I entered /dev/md/0 instead of /dev/md0 in /etc/fstab

Rebooting works.

So, not only do I have to circumvent partman, but also the grub installer in debian installer.
I wonder how the debian installer would install grub on a RAID system though, since it has the option when doing it manually (I presume)