Ready for the weekend
- September 17th, 2010
- By jrod
- Write comment
Archive for September, 2010
I set up a twitter for my aion toon. I think I should go to bed.
What else can you do when you are waiting on a rift…
Well, I nuked / (root) on my work computer today and it finally occurred to me how this happened.
I was working on a gentoo deployment image for a customer. I didn’t want to manually build a kernel for all hardware options, so I was using genkernel.
I needed to rebuild the kernel to include nic drivers for net booting. As it turns out, when running genkernel, the program attempts to mount /boot (based on the fstab) before copying the initramfs image and kernel to /boot (brilliant?). Under normal circumstances, this is perfectly ok, however, I was working in a chroot, with the host /dev bind mounted under the chroot /dev. The chroot fstab specified /dev/sda1 as boot while on the host device… drum roll .. this actually corresponded to (what was) my root partition.
After I was done with my work, I ran my deployment script; which tars up the important parts of the file system and deletes the source; which this time, included my root partition.
So, what have I learned…
Never mount /dev in a chroot unless you actually need access to the hardware. ESPECIALLY, when using Tardix.
From The Gentoo Genkernel Guide
–no-install: Activates [or deactivates] the make install command, which installs your new kernel image, configuration file, initrd image and system map onto your mounted boot partition. Any compiled modules will be installed as well…
(note, it doesn’t mention that it will try to mount /boot if it is not mounted….)
Does anyone know if make install attempts to do this? I think not! I hope not. If we forget to mount /boot (and we wanted to mount boot) when running make install, and we are too dumb to figure out why it doesn’t work.. please don’t try to fix it for us.. please.. we need to learn.. or maybe .. just maybe.. we knew what we were fucking doing in the first place!!!!!!
FUCK!