Hot answers tagged

51

Alternate Method file -s didn't work for me in Ubuntu Lucid because my file command's magic files were out of date. Another way to do this if your magic files haven't caught up with GRUB changes 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 \|...


41

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...


19

DEBIAN / UBUNTU root PASSWORD RECOVERY First screen - grub - press e Modify kernel line: add single between ro quiet and at the end of this line add init=/bin/bash Press F10 When the prompt is root@(none):/# you have to remount the / partition to have read-write access: mount / -rw -o remount Now you are ready to modify the root password: type passwd and ...


15

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 from ...


15

I was having the same problem while rebuilding a degraded SW-RAID array, and tripped over this on another website: The grub-2.00 source where the warning arises is in ./grub-core/disk/diskfilter.c and has this comment: /* TRANSLATORS: This message kicks in during the detection of which modules needs to be included in core image. This happens in the ...


15

Had the same thing today. Turns out it's caused by grub-probe trying to access partitions through /dev/sda, which is not cache-coherent with /dev/sda1 (and sda2 etcetera). You can fix it using blockdev --flushbufs /dev/sda1 (repeat for other partitions as necessary).


13

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 ...


13

The solution is in tuned, as pointed out by @michael-hampton. The tricky part is that the vm plugin can only configure the /sys/kernel/mm/transparent_hugepage/enabled setting. To disable the /sys/kernel/mm/transparent_hugepage/defrag setting too, I had to create a script that is called by the profile on start. At the end, the complete solution is: step 1: ...


12

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 making ...


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 ...


7

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.


7

FYI: I got through it ok. In my setup, I installed GRUB on both /dev/sda and /dev/sdb, and it worked swimmingly.


6

You can use grub-emu to see the menu that grub will show when the machine next reboots. $ sudo apt-get install grub-emu $ sudo grub-emu On my desktop machine the menu was displayed as expected, although if I actually pretended to boot a kernel I got a "no such device" error. I think that is expected behaviour. On my DigitalOcean VPS no entries were ...


6

I think you can just do grub-install /dev/sda grub-install /dev/sdb grub-install /dev/sdc grub-install /dev/sdd grub-install /dev/sde grub-install /dev/sdf grub-install /dev/sdg I can't really foresee what kind of problems you'll be having with grub's HD addressing, though, if your disks are mixed up.


6

This is an old chestnut. The short answer is that "grub-install" is often the wrong answer for Software RAID. Here is an example where I have a 3-way RAID-1 array. The /boot partition is stored at /dev/md0. This installs GRUB to each disk, so that if one disk fails, you can boot off one of the other disks. # grub grub> find /grub/stage1 (hd0,0) (...


6

I've been wasting several hours too on that problem, and finaly I found out what was going on : I'm partially blind... OR the interface is not working well sometimes. First, when you use an OVH template to install your centos, just before the last confirmation, you have the possibility to clic "install the original kernel", just between "installation URL" ...


5

While Craig's answer will definitely work, I discovered the following also works: Hit the reset button and immediately click into the Virtual Machine Connection window so that it grabs the keystrokes. Frantically hammer both shift keys and the ESC key while until you get a GRUB menu. Apparently holding down the shift key or pressing it in a less manic ...


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.


5

Create the directory /etc/default/grub.d if it doesn't exist already. Create a file /etc/default/grub.d/myextraoption.cfg adding to the variable you want (Append to it only, with an extra space. You want to be careful to not clobber or mangle any existing data there.): GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} extra-option" Run update-grub....


4

Add GRUB_RECORDFAIL_TIMEOUT=0 to /etc/default/grub and that is solved my problem on Ubuntu Server 12.04.4 Grub uses GRUB_RECORDFAIL_TIMEOUT as the timeout when last boot failed. Its value defaults to -1, which means wait forever.


4

You can edit the boot options right from the grub menu before selecting an option. I believe you press "e" to edit the entry. You can then change the options for that boot to something different. Once you are booted into the system, you can edit your grub.conf file again.


4

you can pre-load debconf answer with 'debconf-set-selections' first, install debconf-utils on a host that already has grub-pc installed. then run: debconf-get-selections | grep grub-pc > /tmp/grubpc.debconf you'll have a file that looks something like this: grub-pc grub2/kfreebsd_cmdline string grub-pc grub2/device_map_regenerated note grub-pc ...


4

This is rather a bug and the solution is already given at how to force grub to boot (no human input) regardless previous booting failure bug: https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/841009


4

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


4

If there had been a power loss fsck will run anyway since the filesystem will not be marked as "clean". You can use tune2fs -c 1 /dev/sda to set the check-interval for ext2/3 to one. IMHO that should force an fsck on every boot.


4

$ ls /proc/fs ...should show cifs if you're on the new kernel.


4

Grub is able to read from your root file system all by itself. It is in essence a miniature operating system: it has driver code to talk to (some of) your hardware, and it has file system code to understand the layout of your filesystem. Take a look in /boot/grub. The *.mod files are driver modules: ata.mod for ATA hard drives, ext2.mod for ext2/3 file ...


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