Tag Info

Hot answers tagged

28

file -s didn't work for me in Ubuntu Lucid. Another way to do this is to examine the first 512 bytes of the device using the dd command like this: user@host:~$ sudo dd bs=512 count=1 if=/dev/sda 2>/dev/null | strings ZRr= `|f \|f1 GRUB Geom Hard Disk Read Error This sends the output of the dd command through the strings command thus stripping out ...


26

For Ubuntu 12.04 LTS there is a specific option that can be set in /etc/default/grub. For example, if you want to have a 2 seconds timeout (thus avoiding hangs for unattended reboots) just add the following line in /etc/default/grub: GRUB_RECORDFAIL_TIMEOUT=2 Remember to run update-grub after that...


24

First the lecture: Rule Number Zero: If you do not understand what something does, DO NOT TOUCH IT Deleting files "to save space" with no concept of what you are doing will anger the operating system gods, resulting problems similar to what you are now experiencing (Things break. Fixing them is often non-trivial). Now the sympathetic assistance: ...


17

Here are instructions for Ubuntu 10.10, which are slightly different from prior versions. In file /etc/grub.d/00_header comment out the stupid check for a prior boot failure: ##if [ \${recordfail} = 1 ]; then ## set timeout=-1 ##else set timeout=${2} ##fi Then update: sudo update-grub Be aware that if there is a second drive with Linux attached, ...


15

you can use file(1) to identify GRUB in an MBR. e.g. # file -s /dev/sda /dev/sda: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, stage2 address 0x2000, stage2 segment 0x200; partition 1: ID=0xfd, starthead 1, startsector 63, 1044162 sectors; partition 2: ID=0x82, starthead 0, startsector 1044225, 1028160 sectors; partition 3: ID=0xfd, ...


14

Those messages are nothing to worry about. They're related to using lilo as your bootloader, because it uses those symlinks to find your "current" kernel. Grub, being more flexible, has it's own way of doing things, and doesn't need the symlinks.


9

You souldn't need to re-run grub you would, but after a kernel change you may need to run /usr/sbin/update-grub. Those messages are probably do not indicate an issue. The real test would be to simply reboot the computer. If it boots fine, then nothing bad happened. You may want to update your /etc/kernel-img.conf and disable the do_symlinks option, and ...


9

Ubuntu has a "cute" (read: annoying) feature where it records a boot failure and sets a grub timeout of -1, disabling auto-boot. You aren't the only one that doesn't like it, see here. You should be able to work around this by editing /etc/grub.d/00_header, find the section that reads.. if [ "\${recordfail}" = 1 ]; then set timeout=-1 ..and change it ...


9

You can boot using a Grub fallback entry. Add another stanza with either your new (or old) options, then choose the known-good as the fallback. Look into adding the panic=5 option as well (resets a system following kernel crash)


9

You can indeed use Grub to boot once only. You can also specify a fallback boot. Essentially, you use default saved at the start of your grub.conf, to indicate that you want to boot a saved entry by default. Then at the end of your experimental boot, use savedefault # to set the older boot options as the new saved value. So that every time you boot the ...


8

In Debian/Ubuntu, grub.cfg is fully generated by scripts and any manual changes made to it will be clobbered. In RHEL/CentOS however, grub.cfg is modified by scripts but manual changes are persisted, and is actually the canonical location for certain settings. The tool which manages grub.cfg is grubby, which is called by /sbin/new-kernel-pkg when kernels ...


7

That was the correct thing to do. The Gentoo LiveCD may have been using the IDE driver instead of the SCSI driver for your (I'm assuming) SATA hard drives. Slower, but guaranteed to be reliable. You shouldn't need to do anything else; your system is stable.


7

I am using grub4dos to dual boot XP and XP64. Both systems are on NTFS filesystems. Setup was simple: I copied the grub4dos folder onto my NTFS file system. Renamed the windows boot loader "ntldr" out of the way and copied the grub4dos boot loader "grldr" to "ntldr". That way I am still using a microsoft standard MBR which makes my corporate required ...


7

1) How can I detect if grub is installed in /dev/sdb's MBR? You can issue: # dd if=/dev/sda bs=512 count=1 | xxd | grep -i grub 1+0 records in 1+0 records out 512 bytes (512 B) copied, 0.00103986 s, 492 kB/s 0000180: 4752 5542 2000 4765 6f6d 0048 6172 6420 GRUB .Geom.Hard 2) Is it safe to run grub-install in /dev/sdb? Is this the correct way of ...


6

I came across this deeply unpleasant design oversight with Ubuntu Server 9.10. Your fix has helped me enormously. I just wanted to point out that the fix needed for 9.10 is different as there is no "make_timeout ()" function in the same file. For Ubuntu 9.10, go to the end of the same file (00_header) and change the following: if [ \${recordfail} = 1 ]; ...


6

Ok I found solution myself via shlug mail list. what you do is to modify the /etc/grub.d/00_header and find: if [ "${recordfail}" = 1 ]; then set timeout=-1 else set timeout=3 fi change timeout = -1 to 0. -1 means manual selection. also remember to update-grub afterward, to generate the actual grub.cfg


6

You want to install grub. Without it, how are you going to boot Ubuntu after the upgrade? You shouldn't treat a virtual server any differently than a physical one, both need a bootloader to bootstrap the OS at boot.


6

One method: Append init=/bin/bash to the end of the grub line which begins with linux (and ends with quiet). Reset your password and reboot normally. Don't forget it again. Consider installing sudo. Another method: Since this is apparently a virtual machine, you can mount its disk on another (working) virtual machine and manually remove the password ...


5

Have a look at this documentation. i have done this before and it's not hard, just requires a bit of patience.


5

The best course of action would probably be to just let Windows 7 install it's own boot-loader since it won't play nice with grub, then boot from the Ubuntu cd and fix grub afterwards.


5

To quote a bit from the GRUB Manual which adds a bit of extra checking for katriel's answer. You can teach GRUB to boot an entry only at next boot time. Suppose that your have an old kernel old_kernel and a new kernel new_kernel. You know that old_kernel can boot your system correctly, and you want to test new_kernel. To ensure that your system will ...


5

This can be achieved quite easily by using the dd(1) command and copying the first 512 bytes from a given medium. Like: dd if=/dev/sdX of=mbr-sdX bs=512 count=1 Then check if that file contains the hex signature ``0xAA55'' (don't forget to account for endianess of the machine). See [1] for more details. ...


5

Are you using a particular distribution? On Debian based distributions it would be as simple as adjusting /etc/default/rcS and set FSCKFIX to yes. If you want to force a full fsck after every boot, then you could simply write create an empty file named /forcefsck. Though I do not suggest you actually do this.


4

Update: Based on your entry, I found the article "Grub chainloads syslinux and back", which basically says "patch grub": Chainloading syslinux from GRUB seems not to be possible without a patch. I don't know about GRUB2. This could be useful for multi-booting (syslinux-based) partitions. Chainloading syslinux from GRUB4dos (on different ...


4

If you install a new kernel through yum it will appear in your boot list. I think yum takes the current one, makes it a second entry, then makes the new kernel the default/first entry. This lets you boot the old kernel if you need after updating and having a problem.


4

After doing some research, apparently you need to edit the /etc/default/grub file and add the following line: GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0" Then run the update-grub command which will update /boot/grub/grub.cfg accordingly.


4

Use a boot cd! - mount your root partition to /mnt/root/ - change /etc/shadow to root::[and so on] - OR type: "chroot /mnt/root passwd" - reboot, login with empty password or the new one you specified


4

This is embarrassing but after two days of bashing my head on this, I think I solved it myself. My grub menu file had commands like root(hd0,0) instead of root (hd0,0). The space is essential, and all my attempts left it out! I found this out by discovering that leaving the root line off and specifying the full path like kernel (hd0,0)/boot/vmlinuz.... ...


4

I stumbled onto the answer in the grub2 debian source package. It turns out that it does require a dump of the bootsector - so a separately packaged script might be useful. Here is a script (just a wrapper around the official function) that will tell you whether or not grub2 has been installed into the boot sector. It can be easily modified for similar uses. ...


4

You can't install grub or custom kernel on OpenVZ VPS. It's OS-level virtualization system.



Only top voted, non community-wiki answers of a minimum length are eligible