Public bug reported:

Binary package hint: grub2

(yes, package not installed, I removed it after it bricked my system)

Due to incessent boot and driver issues I converted my ubuntu system to
run in a chroot jail.

the next apt-get dist-upgrade bricked my system by installing grub on
the host drive.

Normally you would think, ok it boots the guest kernel and this can be
fixed from within.

However, in this case, / wasn't the root of any partition so it could
not boot.

Since grub-install was root, it could have checked for this
straightforwardly:

int check_for_root()
{
        int fd1, fd2;
        struct stat st1, st2;
        fd1 = open(".", O_RDONLY, 0);
        chdir("/");
        if (chroot("/etc")) return 3;
        stat(".", &st1);
        stat("..", &st2);
        if (st1.st_dev == st2.st_dev) {
                if (st1.st_ino == st2.st_ino)
                        return 2; /* REAL ROOT */
                return 0; /* CHROOT */
        }
        return 1; /* CHROOT ON MOUNTPOINT (probably safe to run bootloader) */
}

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: grub-pc (not installed)
Uname: Linux 2.6.32-5-amd64 x86_64
NonfreeKernelModules: minix vboxnetadp vboxnetflt vboxdrv snd_hda_codec_nvhdmi 
snd_hda_codec_via snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss 
snd_mixer_oss snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event i2c_nforce2 
shpchp video snd_seq snd_timer snd_seq_device snd soundcore snd_page_alloc 
tpm_tis edac_core k8temp i2c_core pci_hotplug output parport_pc tpm 
edac_mce_amd tpm_bios pcspkr parport evdev asus_atk0110 button wmi psmouse 
serio_raw processor ext3 jbd mbcache usbhid hid sg sr_mod cdrom sd_mod 
crc_t10dif ata_generic ohci_hcd pata_amd ahci ehci_hcd floppy forcedeth libata 
scsi_mod usbcore nls_base thermal thermal_sys
Architecture: amd64
Date: Sun Aug  1 19:40:53 2010
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2

** Affects: grub2 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug lucid

-- 
grub-install bricks systems if ran in a chroot jail
https://bugs.launchpad.net/bugs/612409
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to