Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
wiki:grub2_from_grub1 [2011/04/18 04:25] – external edit 127.0.0.1 | wiki:grub2_from_grub1 [2022/09/21 17:10] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | |||
+ | |||
+ | ====== | ||
+ | This wiki assumes you are migrating from grub-legacy to grub2, which is a completely different bootloader. | ||
+ | |||
+ | TRY IT AT YOUR OWN RISK. It would be nice if you know how to use a live cd if you find you have any issues. I suggest you try it out first in a virtual machine, then onto a USB stick. | ||
+ | |||
+ | |||
+ | Grub2 uses some similar command names to grub-legacy. | ||
+ | |||
+ | Especially grub-install | ||
+ | |||
+ | < | ||
+ | |||
+ | If found, | ||
+ | |||
+ | Checking your MBR. This is OPTIONAL. Although there are ways of checking using qemu....I have not used qemu for years so prefer a quicker test. | ||
+ | |||
+ | I install binutils which gives access to command strings | ||
+ | |||
+ | |< | ||
+ | |||
+ | change sda to hda etc | ||
+ | |||
+ | Legacy MBR may look like this | ||
+ | |||
+ | < | ||
+ | root@box:~# sudo dd if=/dev/sda bs=512 count=1 | strings | ||
+ | ZRiI | ||
+ | D|f1 | ||
+ | GRUB | ||
+ | Geom | ||
+ | Hard Disk | ||
+ | Read | ||
+ | Error | ||
+ | 1+0 records in | ||
+ | 1+0 records out | ||
+ | </ | ||
+ | while grub2 in MBR may look like this | ||
+ | |||
+ | < | ||
+ | root@box:~# sudo dd if=/dev/sda bs=512 count=1 | strings | ||
+ | ZRi= | ||
+ | '|f1 | ||
+ | \|f1 | ||
+ | GRUB | ||
+ | Geom | ||
+ | Hard Disk | ||
+ | Read | ||
+ | Error | ||
+ | 1+0 records in | ||
+ | 1+0 records out | ||
+ | </ | ||
+ | |||
+ | TIP....If you have TWO x f(s) you have grub2 | ||
+ | |||
+ | Leaping ahead, when you install any grub2 package, use cPanel to ensure no grub2 packages persist over reboot please. The way the package maintainer has designed the grub2 for TC, is to act the same way as grub-legacy. That means, it used grub.cfg as an " | ||
+ | |||
+ | |||
+ | ====== | ||
+ | |||
+ | ===== Part one ===== | ||
+ | As grub2 depends on grep, replacing busybox grep, my /bin/true command now works. Please read this carefully. It's a safer option. | ||
+ | |||
+ | Firstly your MBR remains grub-legacy. | ||
+ | |||
+ | Secondly I suggest you use the cPanel and tab to Ondemand and allow your grub2 packages to be "on demand" | ||
+ | |||
+ | Then click your menu to ondemand install grub2.tcz into the ram system. Or install grub2 if you prefer it the traditional way. | ||
+ | |||
+ | As no installer scripts were activated by your install or ondemand activity, we have more to do. | ||
+ | We manually install grub2 packages into your grub folder...adjust for your persistent tce directory please. | ||
+ | |||
+ | < | ||
+ | |||
+ | TIP I prefer you copy and paste from web browser to your terminal...and adjust the --boot-directory for your persistent partition if needed......to avoid typos please. The option --boot-directory was called --root-directory in release 1.98 and earlier. | ||
+ | |||
+ | The references link explains, this tricks grub2 into thinking by the bin/true switch....that it is actually installed in MBR when it is NOT! | ||
+ | core.img does not exist in the grub2.tcz, it has to be created by the above command. | ||
+ | |||
+ | Test with the dd command will confirm that your legacy grub is still in MBR. | ||
+ | |||
+ | But you now have populated your tce dir boot/grub with lots of grub2 files. | ||
+ | |||
+ | Then create or copy and paste the grub.cfg into that boot/grub folder. | ||
+ | |||
+ | Next we amend your legacy menu.lst to add a new title, using root powers | ||
+ | |||
+ | < | ||
+ | kernel / | ||
+ | |||
+ | Please note...there is no initrd line. | ||
+ | |||
+ | Reboot to test.....Choosing new menu item should jump you to a grub2 menu. | ||
+ | |||
+ | I show a basic grub-legacy menu.lst | ||
+ | |||
+ | < | ||
+ | title Tiny Core 3 | ||
+ | kernel / | ||
+ | initrd / | ||
+ | |||
+ | title grub2 core | ||
+ | kernel / | ||
+ | </ | ||
+ | |||
+ | |||
+ | If you wish to test wallpaper or locale, you can install those packages or install OnDemand as well. | ||
+ | ===== Part two ===== | ||
+ | |||
+ | If grub legacy menu successfully jumps to the grub2 menu....and successfully boots for you, then you can install grub2 into MBR if you like it. | ||
+ | |||
+ | ====== | ||
+ | ===== For persistent hard drives ===== | ||
+ | |||
+ | Check where your /boot/grub is, it may be /mnt/hda1 or somewhere else. | ||
+ | TIP...... turn off all non-essential devices and remove non-essential USB devices.....unless you are installing to an USB device. | ||
+ | |||
+ | < | ||
+ | |||
+ | Please note that TC is different from " | ||
+ | |||
+ | Jason W reports that grub2 scripts can not generate a grub.cfg as grub2 is looking for boot/grub under / and not a different folder. | ||
+ | |||
+ | Feel free to correct this wiki anywhere that I am wrong please. | ||
+ | |||
+ | So we still need to place an effective grub.cfg under grub folder. See the grub.cfg section for more information please. | ||
+ | |||
+ | ===== For persistent USB drives or sticks ===== | ||
+ | |||
+ | Please run | ||
+ | < | ||
+ | |||
+ | and confirm your target usb device....if hard drive is sda...usb is likely to be sdb....and its relevant partition number. | ||
+ | |||
+ | For those people with IDE drives, that TC reports as hdx, your USB device may be detected as sda. | ||
+ | |||
+ | The cheatcode waitusb=5 | ||
+ | |||
+ | cat / | ||
+ | |||
+ | The other concern is how your bios detects the boot order on reboot. My bios treats hard drives as internal or usb....and I then choose which is the first drive detected. So if USB is not inserted...it falls back to internal.......YMMV See also the next section for suggestions on keeping your hard drive as first bootable device with USB inserted. | ||
+ | |||
+ | Install with.... | ||
+ | < | ||
+ | |||
+ | TC tools create /etc/fstab in internal to external device order. That means that while I initially thought if my bios was usb first, usb should appear as sda....it was actually sdb. This affects our cheat codes which may be | ||
+ | |||
+ | max_loop=256 tce=sdb1 waitusb=5 | ||
+ | |||
+ | If you elected to have persistent home and opt, you may reduce some files in the backup as per forum suggestions. | ||
+ | |||
+ | A cut down grub.cfg without any wallpaper becomes | ||
+ | |||
+ | < | ||
+ | menuentry USB { | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Once hard drive or USB install to MBR works suggest you remove packages ===== | ||
+ | |||
+ | In the core.img section, we needed some kind of persistence of grub2, in order to perform the install into MBR commands. | ||
+ | |||
+ | Once you are happy that grub2 is in MBR and working, there is no need to persist those packages any longer. Therefore use the cpanel, Apps Audit to delete them from any OnDemand Maintenance | ||
+ | |||
+ | Feel free to ignore this suggestion but the only true persistence needed are files that populate boot/grub. | ||
+ | |||
+ | |||
+ | |||
+ | ===== Bios options for USB devices, where your hard drive is grub-legacy or grub2 ===== | ||
+ | |||
+ | If your bios boot order remains internal then USB, and usb device is detected at BIOS stage then, edit your internal drives config/menu file to allow the second device to either be chainloaded or booted direct. | ||
+ | < | ||
+ | internal drive = hd0 (legacy or grub2 bootloader) | ||
+ | external drive = hd1 (grub2 in USB MBR) = usb device | ||
+ | - ######## | ||
+ | LEGACY | ||
+ | - ########## | ||
+ | | ||
+ | title chainload to usb | ||
+ | root (hd1) | ||
+ | chainloader +1 | ||
+ | |||
+ | title boot usb direct | ||
+ | root (hd1,0) | ||
+ | kernel / | ||
+ | initrd / | ||
+ | |||
+ | - ####### | ||
+ | GRUB2 | ||
+ | - ####### | ||
+ | |||
+ | menuentry " | ||
+ | set root=(hd1) | ||
+ | chainloader +1 | ||
+ | } | ||
+ | |||
+ | menuentry "boot usb direct" | ||
+ | set root=(hd1, | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Note I placed in a code box for wiki format reasons. If you need a menu, copy and paste only the relevant section(s)....this is not meant to be a full copy paste because if you mix up your " | ||
+ | |||
+ | |||
+ | |||
+ | ====== | ||
+ | ===== Latest grub.cfg | ||
+ | Our install has only got grub2 in MBR we also need a correct grub.cfg file. | ||
+ | |||
+ | Either create your own or copy and paste this section in the code box please. Wiki Version 1 may change while wiki is under construction. Once wiki is published please up the version number so people know its changed please. | ||
+ | |||
+ | < | ||
+ | - This is wiki version 1 | ||
+ | |||
+ | - grub2 counts from 0 for all things except partition numbers which count from one | ||
+ | |||
+ | |||
+ | - Remove hash from set default line and | ||
+ | - change default number to where ever your boot partition is please | ||
+ | - set default=2 | ||
+ | |||
+ | |||
+ | - Remove hash from set timeout line and | ||
+ | - change 5 to a different number of seconds if needed | ||
+ | - set timeout=5 | ||
+ | |||
+ | - ##################### | ||
+ | |||
+ | - unicode.pf2 font is from package called grub2-unicode-font.tcz | ||
+ | |||
+ | if loadfont / | ||
+ | set gfxmode=" | ||
+ | | ||
+ | | ||
+ | if terminal_output gfxterm ; then true ; else | ||
+ | # For backward compatibility with versions of terminal.mod that don't | ||
+ | # understand terminal_output | ||
+ | | ||
+ | fi | ||
+ | fi | ||
+ | |||
+ | insmod jpeg | ||
+ | if background_image / | ||
+ | set color_normal=black/ | ||
+ | set color_highlight=magenta/ | ||
+ | else | ||
+ | set menu_color_normal=cyan/ | ||
+ | set menu_color_highlight=white/ | ||
+ | fi | ||
+ | |||
+ | - ########## locale settings are here ############################### | ||
+ | |||
+ | - non-en locale need grub2-locale.tcz to be installed and actioned | ||
+ | - as per wiki section for locale | ||
+ | |||
+ | set locale_dir=/ | ||
+ | set lang=en | ||
+ | |||
+ | - Change en to ast, ca, de, fi, fr, hu, id, it, nl, ru, sv, zh_CN | ||
+ | - if needed | ||
+ | |||
+ | |||
+ | - ############### | ||
+ | |||
+ | menuentry hda1 { | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | menuentry sda1 { | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | menuentry "USB sdb1" { | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | menuentry "USB sda1" { | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | menuentry hda5 { | ||
+ | set root=(hd0, | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | menuentry "base norestore" | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | menuentry " | ||
+ | set root=(hd1) | ||
+ | chainloader +1 | ||
+ | } | ||
+ | |||
+ | menuentry " | ||
+ | set root=(hd0, | ||
+ | chainloader +1 | ||
+ | } | ||
+ | |||
+ | menuentry sda1-old { | ||
+ | set root=(hd0, | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | menuentry sda1-remastered { | ||
+ | set root=(hd0, | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | - ##### menuentries using LABEL | ||
+ | |||
+ | menuentry LABEL { | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | |||
+ | menuentry "USB LABEL" { | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | - #### chainload back to grub-legacy for | ||
+ | - #### those using the core image way | ||
+ | |||
+ | menuentry " | ||
+ | set root=(hd0) | ||
+ | chainloader +1 | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | If you do not create a grub.cfg or copy paste above, on reboot you will drop to the grub prompt and be forced to use command to boot your system or run a live cd to rescue your system. | ||
+ | |||
+ | |||
+ | On reboot you may get this, if you have no wallpaper found. Image may differ from current grub.cfg | ||
+ | |||
+ | If we upgrade our kernel and use different version numbers, my config file will not update unless you modify it manually. Alternatively, | ||
+ | |||
+ | ===== My partition is not in your config file or wrong default number? ===== | ||
+ | Sorry. Please use root powers to edit before rebooting. Remember the only change from grub-legacy in counting is grub2 counts partions from ONE. | ||
+ | |||
+ | So if you need to chainload to partition 7 edit partition 5 to (using root powers) | ||
+ | |||
+ | < | ||
+ | set root=(hd0, | ||
+ | chainloader +1 | ||
+ | }</ | ||
+ | |||
+ | I have disabled the set default settings and timeout. If you like one of my entries, uncomment those lines and edit with root powers to adjust the default number.....remember grub2 counts menuentries from zero. | ||
+ | |||
+ | ===== Config file and Symbolic | ||
+ | |||
+ | This is my attempt to not have to change my grub.cfg every time there is a new TC iso. Use root powers to symbolically link old kernels and initrds to bzImage-old tinycore.gz-old then add your new bzImage and tinycore.gz to filesystem. | ||
+ | |||
+ | |||
+ | You are welcome to ignore this suggestion. | ||
+ | |||
+ | eg < | ||
+ | cd / | ||
+ | ln -s bzImage bzImage-old | ||
+ | ln -s tinycore.gz tinycore.gz-old | ||
+ | mkdir /tmp/z | ||
+ | mount -o loop tinycore-latest.iso /tmp/z | ||
+ | cp / | ||
+ | cp / | ||
+ | </ | ||
+ | ===== Partition naming using LABEL= ===== | ||
+ | |||
+ | This section is optional but resolves most confusions in the USB section on whether to use sda1 or sdb1 etc....as labels are a viable and easy solution. It is just as easy to use it for hard drive booting. | ||
+ | |||
+ | The other wiki refers to using UUID. | ||
+ | http:// | ||
+ | |||
+ | I prefer you install package e2fsprogs_apps.tcz ............which gives access to command e2label. | ||
+ | |||
+ | The first time you run it, you check if your partition already has a label with | ||
+ | |||
+ | < | ||
+ | (if the response is a blank line, you had no label set) | ||
+ | |||
+ | (To label or change label run) | ||
+ | sudo e2label /dev/hda1 newlabelname | ||
+ | |||
+ | (repeat first command to see if label has been set correctly | ||
+ | sudo e2label /dev/hda1 </ | ||
+ | |||
+ | Change hda1 to your target partition if applicable please. | ||
+ | |||
+ | If you like labels, check that all of your new menuentries boot correctly, before deleting any /dev style entries. | ||
+ | There is no need to delete anything, but some people do ....to keep it simple. | ||
+ | |||
+ | This means the minimum grub.cfg you would have is: | ||
+ | |||
+ | < | ||
+ | |||
+ | menuentry LABEL { | ||
+ | linux / | ||
+ | initrd / | ||
+ | } | ||
+ | |||
+ | menuentry DEV { | ||
+ | linux / | ||
+ | initrd / | ||
+ | }</ | ||
+ | |||
+ | I have removed other cheatcodes to focus your mind on the label versus dev entry. | ||
+ | |||
+ | ===== Settings not recommended in your grub.cfg | ||
+ | |||
+ | Unless you know what you are doing, please do not have any settings that are called | ||
+ | |||
+ | savedefault or hiddenmenu. | ||
+ | |||
+ | IMHO it can lead to some people getting into difficulty. | ||
+ | |||
+ | savedefault can interfere with the setting default. | ||
+ | |||
+ | hiddenmenu ......arch wiki says you need to hold the shift key to UN-hide it, which IMHO is non-intuitive. | ||
+ | |||
+ | ====== | ||
+ | |||
+ | Firstly check the current grub.cfg wiki entry to see if your locale is currrently supported. Then install grub2-locale.tcz | ||
+ | |||
+ | Next do this please | ||
+ | |||
+ | < | ||
+ | |||
+ | (We do not use /usr/local pathway to ensure we are only using locales supported by grub2.) | ||
+ | |||
+ | Change sda1 to where ever your grub/ folder partition is please. | ||
+ | |||
+ | Check that your boot/ | ||
+ | |||
+ | I prefer you do at least one reboot using English to make sure that the config works....before trying out a different locale. | ||
+ | |||
+ | ====== | ||
+ | |||
+ | grub-legacy defined stuff without equals signs but grub2 needs them, except in some scripts. | ||
+ | |||
+ | set default=0 | ||
+ | Also if highlight colors are used, it means make that the active menu line as per above image. | ||
+ | |||
+ | set timeout=5....countdown in seconds (5) to boot the default menuentry. | ||
+ | (Even if you have only one entry, I prefer you keep those above lines in your config.) | ||
+ | |||
+ | set root=(hd0, | ||
+ | All other counts in grub2 start from 0 including counting MBR's and menuentries. | ||
+ | |||
+ | grub-legacy title is now menuentry but we need { } to enclose our grub2 commands. | ||
+ | |||
+ | Some grub2 configs now like you to place "" | ||
+ | |||
+ | linux = grub-legacy kernel command | ||
+ | |||
+ | initrd remains unchanged. | ||
+ | |||
+ | kernel cheatcodes remain unchanged. | ||
+ | |||
+ | So if your grub-legacy title was | ||
+ | |||
+ | My kernel with wireless built June 1999 | ||
+ | |||
+ | ..........................................that is too long and will need to be enclosed with " at both ends. | ||
+ | |||
+ | Also please have a gap between the string in your menuentry and the curly bracket so grub2 would be | ||
+ | |||
+ | < | ||
+ | blah blah | ||
+ | }</ | ||
+ | |||
+ | The locale settings default is always en. Changing it will only work if (a) you have before reboot copied the locale folder to boot/grub, (b) used root powers to edit to a known locale and I have no way of testing non-en settings. Good luck! | ||
+ | |||
+ | I changed the default location of locale to boot/grub so we do not need to have any files backed up. See the locale section on how to install it. | ||
+ | |||
+ | ===== menu_color = Basic Colors | ||
+ | Grub2 needs US spelling of color. I am Aussie so watch out for my spelling please. | ||
+ | |||
+ | For these lines in our grub.cfg | ||
+ | |||
+ | set menu_color_normal=cyan/ | ||
+ | |||
+ | set menu_color_highlight=white/ | ||
+ | |||
+ | These are the color options | ||
+ | |||
+ | < | ||
+ | black blue | ||
+ | brown cyan | ||
+ | dark-gray | ||
+ | light-green | ||
+ | light-red | ||
+ | </ | ||
+ | |||
+ | In previous image of grub2 at menuentry stage...I pressed the down arrow to stop the countdown clock so I could take a snapshot. Otherwise hda1 would have been the booted option. | ||
+ | |||
+ | Feel free to use above colors to change your grub.cfg . I request you do at least one boot with no changes to colors just to make sure everything is working under my " | ||
+ | |||
+ | |||
+ | ====== | ||
+ | |||
+ | ===== Research your monitor for changing resolution ===== | ||
+ | If you decide to change your resolution from the default of 640x480....at menu you press C for command mode and type command | ||
+ | |||
+ | vbetest | ||
+ | |||
+ | |||
+ | When you press enter the second time....vbetest will test your graphics are bit harder...then press enter again to end the test. | ||
+ | |||
+ | At command mode | ||
+ | |||
+ | < | ||
+ | grub > vbeinfo </ | ||
+ | |||
+ | These are virtualbox shots...my monitor can actually do bigger resolutions...(optional) that is for you to find out for yours. | ||
+ | My actual result against my monitor showed result: 0x169 1680x1050x32.....and those strings like 0x169 are known as vbemode, if you read other wikis. | ||
+ | |||
+ | ===== Your target image ===== | ||
+ | |||
+ | If you add a wallpaper, I have set it to /boot and not /boot/grub so its easier spot. | ||
+ | Please arrange: | ||
+ | < | ||
+ | chmod 755 wallpaper.jpeg</ | ||
+ | |||
+ | I prefer to change wallpaper canvas size using mtpaint....but feel free to leave unaltered and see what effects you can enjoy. | ||
+ | Basically background images and displayed counting 0,0 as top left hand corner of your monitor. | ||
+ | |||
+ | If you like mtpaint here is a quick guide to how to resize.....Open the image with mtpaint.....Pulldown Image.....Click on "scale canvas" | ||
+ | |||
+ | Ideally we set the image canvas to the same vbemode (gfxmode)....but kernel font is a different matter. | ||
+ | |||
+ | The bigger the canvas size...the smaller the menuentry font size appears to be. Lets change that now. | ||
+ | |||
+ | First use root powers to edit grub.cfg to use a smaller canvas ....gfxmode=" | ||
+ | (If you set the color depth lower...you get uglier image) | ||
+ | |||
+ | (B) If you are unsure what your current wallpaper is....for the specs, you may need to install ImageMagick and you can then pulldown File in mtpaint...actions....view image info OR in a terminal run the command. | ||
+ | |||
+ | < | ||
+ | Mtpaint has index info but I am not sure how to use it. | ||
+ | |||
+ | ImageMagick can also use a command to resize canvas and color depth. So then use a graphics application to resize canvas to the same gfxmode and depth. | ||
+ | |||
+ | The above image still needs tweaking....we could go back to 640x480 especially if you need to E (for) EDIT and can't read the size of fonts. | ||
+ | Also I would be tempted to change the highlight color to a stronger contrast. | ||
+ | |||
+ | Now that you have the idea, as a general rule..... disk space sizes (at same canvas size) run from smallest jpeg - png - and largest tga. | ||
+ | |||
+ | ===== Wallpaper font ===== | ||
+ | |||
+ | If you want a wallpaper, you need to install separate package called grub2-unicode-font.tcz | ||
+ | |||
+ | There is no installer script. Instead you decide where your persistent boot/grub partition is and install it manually | ||
+ | |||
+ | < | ||
+ | |||
+ | Change /mnt/sda1 to where ever your persistence is please. | ||
+ | |||
+ | The grub.cfg shows that the font file is under boot/grub but we have your wallpaper under boot/ because you may like to find the wallpaper and change it. | ||
+ | |||
+ | ===== Explanation of the wallpaper sections of grub.cfg ===== | ||
+ | |||
+ | I am not a script guru. | ||
+ | |||
+ | The wiki grub.cfg first script attempts to test if you have a grub2 font called unicode.pf2 which is obtained from a separate TCZ. The reason for the separation is to allow users to just get a grub2 ....text menu...as unicode is over 1 MB download. If the font exists, the terminal...the screen border and its text etc...are defined. | ||
+ | |||
+ | If the font exists, gfxmode is then set at the appropriate canvas size and (optional) color depth. | ||
+ | |||
+ | However, generally speaking its better to define color depth. | ||
+ | |||
+ | The larger the depth and canvas size.....the slower the image will take to load. | ||
+ | |||
+ | The bottom script inserts a jpeg module. Grub2 can also use png or tga formats but please change insert module command and filename to match. | ||
+ | If the wallpaper file is found...placed in boot/ to make it easier to find....then the --/black acts as a transparency to NOT interfere with the wallpaper shining through for you to enjoy. My magenta and the image shows what is the active text that I have either arrowed down to or set by the default command. | ||
+ | |||
+ | If no wallpaper is found....then the scripts sets the more basic color set for a blue background etc. | ||
+ | |||
+ | ====== | ||
+ | |||
+ | Check that your grub-install command has populated your persistent boot/grub with lots of files. | ||
+ | |||
+ | (Optional....Check your MBR has changed using the dd command above) | ||
+ | |||
+ | Check that you have created a grub.cfg under boot/grub or copy and pasted from the wiki. | ||
+ | Menuentry must have a gap between your " | ||
+ | |||
+ | Menuentry must be enclosed in " " if too long and | ||
+ | |||
+ | end it with } | ||
+ | |||
+ | Either shutdown or reboot with the tce backup directory box ticked please. | ||
+ | |||
+ | Good luck! | ||
+ | |||
+ | |||
+ | ===== If you have an issue forum link below ===== | ||
+ | |||
+ | Before you reboot, make notes on how to revert to legacy if things go wrong and post to the forum please. Do not try to solve issues unless you are comfortable using grub2 command mode or grub rescue command mode. | ||
+ | |||
+ | http:// | ||
+ | |||
+ | ====== | ||
+ | Grub2 can chainload. See the latest grub.cfg for examples. | ||
+ | Remember grub2 counts hard drives (or bootable USB devices) from zero just like grub-legacy but now counts partitions from ONE. | ||
+ | |||
+ | ====== | ||
+ | ===== If you have a grub prompt (not a grub rescue prompt) ===== | ||
+ | |||
+ | You may find yourself at the grub prompt...with no menu. You can use commands to boot your TC. | ||
+ | |||
+ | The key differences | ||
+ | |||
+ | So if you have multiple systems prefix your linux and initrd commands with something like | ||
+ | |||
+ | set root=(hd0, | ||
+ | |||
+ | Plus, ls command must show that partition exists for grub2 to be able to use it! | ||
+ | |||
+ | Please note that I have tested a number of modules and (a) we do not include .mod in inserting and (b) you can insert all modules with no apparent harm...YMMV....The problem is ....grub2 does not always complain ...if inserting something is useless or failed. | ||
+ | |||
+ | If you can't remember where your /boot partition is...in grub2 terms you could try simple then search commands | ||
+ | |||
+ | simple...ls returns drives detected and partitions detected. | ||
+ | |||
+ | If you can't remember a special kernel cheatcode...try cat command to view your existing config file | ||
+ | |||
+ | Note that I have pressed the TAB key....which also works for grub-legacy to " | ||
+ | |||
+ | Also, grub2 should detect the correct number of available drives and show that the normal module is loaded. Normal.mod is the basic module that helps to give you the text menu. | ||
+ | |||
+ | The bottom of above image shows....using the " | ||
+ | |||
+ | In above image I have used the TAB key to search for files beginning with gr. But in this test case....I deliberately made an typo instead of copying and pasting the command from the install section that lead to me having grub.cfg1 instead of grub.cfg1. | ||
+ | |||
+ | ===== If you have a grub rescue prompt ===== | ||
+ | ==== -- If you have file not found ==== | ||
+ | |||
+ | According to arch wiki, you may have a module not correctly installed...the " | ||
+ | |||
+ | Try to prevent this by using copy and paste command to copy the grub.cfg into your boot/ folder and check its there. | ||
+ | However, I have limited the number of partition entries, so you may had to edit that file (with root powers) and borked it. | ||
+ | Remember, grub2 counts MBR, drives, menuentries from zero and the only change from grub-legacy is partitions start from ONE. | ||
+ | |||
+ | So let us pretend you see the grub rescue prompt. We try commands to get back our text module called normal.mod | ||
+ | |||
+ | < | ||
+ | insmod (hdx, | ||
+ | normal | ||
+ | |||
+ | (hopefully grub rescue> | ||
+ | |||
+ | Change (hdx,y) to the correct syntax for your boot/ partition is grub2 terms please eg (hd0,5) | ||
+ | If you have only one distro installed, likely to be first partition, you may not need the absolute pathway using (hdx,y) | ||
+ | |||
+ | Below I deliberately renamed my normal.mod to normal.mod1 to force grub2 into rescue prompt....Do not try please. | ||
+ | |||
+ | It is unlikely you are going to destroy that module, but what I can not show you, unless its a movie....after pressing enter after typing normal, grub rescue prompt changes to grub....and then you can use manual commands to boot your system....as per.... if you have a grub prompt section. | ||
+ | |||
+ | The file not found ....in the first image in this section....does refer to normal.mod. | ||
+ | |||
+ | Of interest to me, is that if you can not load normal, can you set (fix) the way grub2 will look for files? as per image | ||
+ | |||
+ | If you can do this, you are likely the to succeed repeating the " | ||
+ | |||
+ | Ok further tests show that if you delete certain modules, you can get to same grub prompt. | ||
+ | |||
+ | Deleting lvm, raid* and crypto* causes no errors (YMMV unless you need them) but deleting gcry* causes borking of my system. | ||
+ | |||
+ | So if you are short of disk space pls take care on what you delete please. | ||
+ | |||
+ | ==== -- If you have no such disk (not found) ==== | ||
+ | |||
+ | This is currently not solvable for me. | ||
+ | |||
+ | disk not found means you will not be able to define a pathway to your modules. | ||
+ | |||
+ | ====== | ||
+ | |||
+ | You may want to revert to legacy. | ||
+ | |||
+ | ===== Are you still using core.img? ===== | ||
+ | |||
+ | If so, you have grub-legacy in MBR and do not need to do anything. If you feel like, you can delete all contents of boot/grub and use grub-0.97-splash.tcz to populate boot/grub and create your menu.lst. | ||
+ | |||
+ | Or, you could remove the core.img menuentry. | ||
+ | |||
+ | |||
+ | ===== If grub2 boots for you ===== | ||
+ | |||
+ | Either as internal hard drive install or USB device we can follow the commands showing in the command box. We can do the following as my grub-install did not delete your menu.lst so we move it out before deleting all other files and then install a fresh grub-legacy with your menu.lst moved back into position for grub-legacy to find it. Feel free to just delete all files under grub/ and doing a fresh install of grub-legacy and manually create your menu.lst. | ||
+ | |||
+ | Hopefully your boot partition is already mounted, if not, mount it please. | ||
+ | |||
+ | < | ||
+ | fdisk -l (to check your target device ....lets pretend its /dev/sda1) | ||
+ | cd / | ||
+ | mv menu.lst .. | ||
+ | (optional) find / -name menu.lst (will report / | ||
+ | rm -f * | ||
+ | cd .. | ||
+ | mv menu.lst grub/ | ||
+ | </ | ||
+ | |||
+ | Note the 2 periods or full stops in above command. If your prefer do it longer try | ||
+ | mv menu.lst / | ||
+ | cd / | ||
+ | |||
+ | Now connect to Apps Browser and install grub-legacy. Go back to root terminal and | ||
+ | |||
+ | < | ||
+ | grub | ||
+ | root (hd0,0) | ||
+ | setup (hd0) | ||
+ | quit | ||
+ | </ | ||
+ | |||
+ | Please change the hd(numbers) if your target boot partition is not on the first partition and you do not want grub-legacy in MBR of first drive please. | ||
+ | ===== If grub2 does not boot for you ===== | ||
+ | |||
+ | Then boot your TC cd and follow almost the same steps as above but we still need to take care which device we are going to revert. | ||
+ | |||
+ | But you will need to mount your hard drive boot/ partition. | ||
+ | |||
+ | Its more critical to run fdisk -l. | ||
+ | |||
+ | ====== | ||
+ | |||
+ | TinyCore forum users especially maro and Jason W for the build script and packages. | ||
+ | |||
+ | http:// | ||
+ | |||
+ | http:// | ||
+ | my source for using / | ||
+ | |||
+ | https:// | ||
+ | especially the set pager=1 tip | ||
+ | |||
+ | ====== | ||
+ | |||
+ | grub-legacy in hard drive MBR | ||
+ | |||
+ | ......chainload to grub2 in MBR of USB device | ||
+ | |||
+ | .......direct boot USB device which has grub2 installed | ||
+ | |||
+ | .........core.img test | ||
+ | |||
+ | grub2 in hard drive MBR | ||
+ | |||
+ | .........direct boot hard drives | ||
+ | |||
+ | ........chainload to grub2 in MBR of USB device | ||
+ | |||
+ | ........direct boot USB device which has grub2 installed | ||
+ | |||
+ | grub2 in USB MBR | ||
+ | |||
+ | .......bios set to boot this device first | ||
+ | |||
+ | Unable to test USB keyboards and non-English locales. Ditto raid or lvm partitons, GPT and non-msdos setups. | ||
+ | |||
+ | |||