Jump to content

nemesys

Active Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by nemesys

  1. Thanks for the extra info. Since I compiled from source I did not have these extra files available in the zip.

    I'll update my post to show both options though both methods will work and the boogie man _won't_ get you if you use memdisk.

    MEMDISK is used to boot an img which is exactly what grldr.

    GRLDR is an IMG.

    GRLDR is _not_ a boot sector which are actual block spaces at the beginning of a physical drive.

    This is so wrong:

    menuentry "Grub4Dos" {
    linux16 /boot/grub/memdisk
    initrd16 /grldr
    }

    MEMDISK is supposed to load floppy images, hard disk images or ISO images, not bootsectors.

    The right way to load Grub4Dos from grub2 is to use the kernel version of Grub4dos (grub.exe):

    menuentry "Grub4Dos" {
    linux16 /boot/grub/grub.exe
    }

    Note: grub.exe doesn't need to be in the root because whole grub4dos is loaded in memory already and doesn't need to read the rest of grldr of the disk.

  2. I redid it using WinGrub GUI (a program that installs Grub4dos) and it placed the grldr in the root. So far so good. When I reboot I get the following errors when trying to boot to the USB:

    Try (hd0,0): FAT32: disk error
    Error

    Any ideas?

    I've seen that one before as well. I suggest a clean partition table written with Linux with fdisk and to use mkdosfs to create a fat32 LBA partition on the drive. Then don't allow your WinGrub to format it if you still chose to use Windows. I would really suggest just using Linux to install the grub4dos also. You can grab the latest version and it's easy to compile/install even in a live distro and your package manager may even have it in the repo. I actually use two computers; grub4dos installed on one computer and grub2 on another.

    There is no indication as to what version WinGrub is using though the grldr location would give me an indication that it's older because with the latest I have no problem booting grldr from /boot/grub.

    As for the error it seems like a new clean partition table is in order without being able to troubleshoot more myself, that is my best advice.

    Remember not to install Grub2 to the MBR; only grub4dos. Many repeat tries and fails can cause the partition table to become borked. Rewriting the partition table is different than simply formatting. One way to create it is with fdisk, fdisk /dev/sdb (or whatever your usb is) then use the o option to create the partition table. Next select n to create a new partition and then the t option to change the partition system id to c which is FAT 32(LBA). Use the a command in fdisk to give the partition the boot-able flag Lastly write it out with the w command. Finally use mkdosfs -L <label> -F 32 /dev/sdb to create the fat 32 file system. You should be good to go then and able to follow the steps I laid out above. I found it much easier to use Linux than supposedly "easy to use" windows programs to do the entire process as those usually end up just causing problems either from variant versions or doing more than what you want them to.

  3. This has yet to work for me after multiple tries. I get an error that says, Cannot find GRLDR. I've verified that it is indeed there.

    I recall running into this problem once before and to solve it I placed grldr in the root of my usb drive.

    I have since formatted and removed it though and it is now located at /boot/grub/grldr and I have no problem booting grub4dos now with it located there.

    Version issue possibly?

    Make sure it is lower case as it is on mine just to see if that makes a difference.

    Also have a look to see if there is a newer version of grub4dos available than you are using.

    Good luck and let me know.

  4. I have not been successfull in getting Pentoo to run from iso using grub2's loopback function yet.

    I just extract it and use something like;

    #Pentoo 
        menuentry "Pentoo" { 
            linux /boot/pentoo/pentoo root=/dev/ram0 init=/linuxrc aufs max_loop=256 dokeymap cdroot looptype=squashfs loop=/pentoo/image.squashfs 
            initrd /boot/pentoo/pentoo.igz 
        }

    Notice the loop=/pentoo/image.squashfs

    That is critical and /pentoo/ is where I chose to put the squashfs file in the root of the usb drive.

    This is all in my post here; http://forums.hak5.org/index.php?showtopic=15487

    Also, for UBCD use the latest beta version v5.0RC1 http://www.ultimatebootcd.com/forums/viewtopic.php?t=2131. It supports the grub2 loopback booting and I don't think 411 does. It also has all the latest software, where 411 is outdated.

    About installing from Windows, I'm not sure though maybe you could use cygwin to accomplish this.

  5. VirtualBox USB Testing on Linux Host

    To test your multipass usb and if you are running a Linux host and VirtualBox I found the correct commands for creating a raw image to directly access the usb stick. This has been covered for Windows host using different methods though the Linux host version has not and the information is rather scarce.

    For example if you have your usb stick connected and it shows up as /dev/sdb we can run a command like this as your normal user;

    VBoxManage internalcommands createrawvmdk -filename ~/.VirtualBox/HardDisks/usbsdb-sony.vmdk -rawdisk /dev/sdb -register

    What this does is create a raw vmdk image that when loaded in VirtualBox will allow booting directly into your usb drive.

    The name of the vmdk is not important I just used usbsdb-sony to acknowledge that it's for my sony usb. The /dev/sdb (or which ever device applies to your usb) is important in this situation. You may want to make several of these (they are only 4kb) in case your device location changes when you plug the usb stick in later, for instance I have one for /dev/sdb and /dev/sdc.

    **NOTE:**

    When creating these raw disk images, they will be associated with the model/brand of the usb device you are creating them for. So you can not use an 8GB Sandisk Cruzer with a vmdk that you made to match a Sony flash drive. You will need to rerun the commands to create a new vmdk to match the appropriate usb stick.

    VBoxManage will complain if you don't put your home .virtualbox path in the command like ~/.VirtualBox/HardDisks/usbsdb.vmdk. This is because of the -register command option on the end.

    If you remove -register from the end and don't give a full path it will create the vmdk image in whatever directory you run the command in without error. So something like;

    VBoxManage internalcommands createrawvmdk -filename usbsdb.vmdk -rawdisk /dev/sdb

    I hope this helps save some time when testing your multi-boot sticks in Linux. I know it sure has for me.

  6. I understand what it's like to get stuck on something and I'm not afraid to ask either.

    It's just that I wanted to reiterate the importance of reading the "fine print". It saves a lot of headache on both parties when figuring out a problem.

    It wasn't a direct hit on you just some advice because understanding what is going on is much more important in the long run than just having a command handed to us.

    Let me know when you get it working and if that solved your problem.

    EDIT: After looking at your picture I also see that it could be an improper device.map. This happens when you install grub and the device has changed, such as from /dev/sdb1 to /dev/sdc1.

    Using the --recheck option when using grub-install is how to re-detect and correct the device.map in /boot/grub/.

    This is also specified in the guide I linked above.

    Ideally you would like it as /dev/sdb1.

    EDIT(2): I made a mistake in the previous post about the -i switch to name your usb device. It should actually be -n so that it looks like;

    mkdosfs -F 32 -n <nameyourusb> /dev/sdb1

  7. It is looking for the module called fat.

    You can specify that using the --modules=fat and it would work though in your case I don't suggest that.

    If at all possible you should use fdisk from Linux to create a new empty dos partition table on the usb drive.

    **Make sure you specify the correct device that is your usb in ALL these operations**

    **Read what each of these programs output carefully also.**

    You will lose any data on the drive if you do this.

    You can use m in fdisk to see all of the options.

    Use the o option in fdisk to create a new empty dos partition table.

    Now, create a new empty partition on the usb stick with the fdisk option n and follow the steps. Next use option t to change the partition's system id to c when it asks.

    That c is the hex correlation that specifies fat32 lba.

    Write it out with w.

    Next use

    mkdosfs -F 32 -n <nameyourusb> /dev/sdb1

    Now you have a clean usb stick. You can then use this guide; http://hak5.org/forums/index.php?showtopic=15487

    to help you with the rest of the installation.

    Please read any section in it's entirety before you attempt the commands.

    I think when we screw around with the usb partitions and mbr a lot it causes bad things and thus the "unable to detect filesystem" error.

    You can use the --modules=fat option to make it work though this will not guarantee that it will boot properly or not cause problems later.

    Also please remember that Linux man is your friend and to RTFM before you just depend on others to give you the answer. You can start by googling both those terms. man man is quite revealing.

  8. I copied and pasted your exact config for kaspersky and it worked fine for me.

    Maybe you need to specify root (hd0,0) above the kernel line in the kaspersky section.

    Replace (hd0,0) with what every your actual thumbdrive is. Specifically if you have multiple hard drives in the computer you are testing on this would cause a problem if it's incorrect.

    It also wouldn't hurt to put a forward slash in front of boot so that it looks like

    loop=/boot/kav/image.squashfs

    It is working both ways for me though.

    BASES.ID needs to be on the root of the thumbdrive too iirc.

    What errors are you getting also?

  9. No it should look like this;

    --BASES
    --boot
        --help
        --isolinux
        --kav
           --rescue.igz
           --rescue
    --kav
        --image.squashfs
    

    Ok, so the file structure should look like this?

    --bases
    --boot
        --help
        --isolinux
        --kav
          --image.squashfs
          --rescue.igz
          --rescue

    thanks.

    It would work your way if you changed the

    loop=/kav/image.squashfs

    to read

    loop=/boot/kav/image.squashfs

  10. This should work if you make a folder on the root of your usb named kav and put the kaspersky image.squashfs in it.

    Also make a folder called /boot/kav and put your rescue kernel image and rescue.igz in it that is on the kaspersky boot iso.

    The BASES folder needs to be on the root of your usb.

    title Kaspersky-Disk-Rescue

    kernel /boot/kav/rescue root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/kav/image.squashfs cdroot quiet noapic

    initrd /boot/kav/rescue.igz

  11. For those wondering about Konboot I seemed to have overlooked it when editing my grub.cfg though have added it back in with the commands below.

    I got memdisk from /usr/lib/syslinux and placed it in my usb's /boot/grub/ directory.

    #Konboot

    menuentry "Konboot" {

    linux16 /boot/grub/memdisk

    initrd16 /boot/img/FD0-konboot-v1.1-2in1.img

    }

    Have a look at this site; Boot PC from Floppy Image w/ GRUB2 and MEMDISK

    As for dban, it is included in UBCD so I am just using that one for now, though I did have Grub2 loading the dban iso using loopback before and it worked flawlessly.

  12. This is a non-distro specific instruction on how to load Grub2 from Grub4Dos and to add background images into Grub2. Also including my example grub.cfg and menu.lst files including many unique distros which we haven't had much guidance on booting with grub2.

    If you would like some very good information on more than is my scope at the moment please find the links at the bottom of this post.

    UPDATES:

    Great!

    1) Grub2 is able to load Grub4Dos grldr without a patch!

    If using the files from the grub4dos zip which include grub.exe

    menuentry "Grub4Dos" {

    linux16 /boot/grub/grub.exe

    }

    If you compiled from source and don't have grub.exe or simply prefer to use memdisk,

    all that needs to be done is to use memdisk from syslinux as the kernel like this;

    menuentry "Grub4Dos" {

    linux16 /boot/grub/memdisk

    initrd16 /boot/grub/grldr

    }

    I got memdisk from /usr/lib/syslinux and placed it in my usb's /boot/grub/ directory.

    This works great. So now we can even load Grub4Dos from Grub2!

    I started this to be able to boot all of what I wanted from grub2, yet I also liked Ultimate Boot CD, though did not want to edit the many menu files to convert them to grub2, that are installed with it. Even though the latest beta UBCD iso supports the loop boot in grub2 I wanted to have a system I could modify such as updating the virus databases and many different tools available in UBCD. This was the outcome of scouring many docs about installing and discussions about the limitations I was dealing with.

    So I present the caveats

    As a note this was all done on an 8GB flash drive using Slackware Linux.

    **CAVEATS**

    1) Do not install grub4dos to the first partition on the device, only to the mbr. I actually did this by mistake and was not able to get grub2 to boot from my usb until I reformatted the partition with a new dos partition table. I would constantly get an "unknown filesystem type" and be dropped in to the grub2 rescue-shell which is very limited.

    2) Do not install grub2 onto the actual partition of the device or the mbr. It's unnecessary and actually will cause problems.

    3) Adding the Grub2 font console coloring in grub.cfg seems to intercept loading the background image.

    There is probably a way around this though I just haven't had the time though you are more than welcome to find a way and I would be happy to know the answer.

    Installation:

    We must create the grub2 files we need. Boot into a running system with grub2 or compile it (download the latest 1.9x version from; and install like I did. It installs to /usr/local/.

    Next use grub-install to create the grub2 core.img and other files we need on the mounted usb drive using the command below. Using grub-setup is discouraged as grub-install calls it if needed anyway.

    grub-install --no-floppy --root-directory=/mnt/usb/ --grub-setup=/bin/true /dev/sdb

    NOTE: It is not required (as I once thought) to actually install grub2 to the mbr and then grub4dos over it. I found that by using the command above we can generate all the necessary files including core.img without actually touching the mbr. When /bin/true is specified it will 'do nothing successfully' when executed instead of overwriting the master boot record. Which is good.

    After this we have the proper /boot/grub/ on the usb device, next we install grub4dos from Windows or whatever Linux you have grub4dos compiled on. Please make sure you are on the grub4dos machine now and not installing grub2 again. The grub4dos will not overwrite any grub2 files in /boot/grub/, only add new ones. Please change what is needed if you are installing grub4dos from Windows. It's very documented if you don't know as I don't since I only use Linux, except for Windows in a VirtualBox machine. To find out how to boot your usb directly into VirtualBox with a Linux host see the bottom of this post.

    Using grub-setup is discouraged as grub-install calls it if needed anyway.

    Install grub4dos to mbr;

    grub-install --no-floppy --root-directory=/mnt/usb/ /dev/sdb (*replace with the proper directory/device*)

    If you get an error about "unable to detect filesystem type" run the above command with --recheck added. This will rescan the hard drives on your computer and generate a new device.map in /boot/grub/

    grub-install --recheck --no-floppy --root-directory=/mnt/usb/ /dev/sdb

    Okay, Doing great so far.

    Next we will need to add our menu.lst and a grldr file into /mnt/usb/boot/grub. I just used the ones from the UBCD /mnt/usb/ubcd/boot/grub/ for the time being. I have an nice light-green on black and vice-verso for highlighting color scheme which you can see in my configs for both grubs that work very well together and look pretty sic.

    In UBCD the /boot/grub/menu.lst just leads to another file located within the ubcd directory at the root of the usb drive.

    If you like UBCD you can use it's main.lst file that /boot/grub/menu.lst points to.

    Once you edit it you will understand. If you choose not to use UBCD then just create a menu.lst in /grub/boot. I have an example attached.

    Remember to get a hold of grldr also to place into the grub folder with menu.lst.

    If you choose to load your own background in grub2 you would just add the lines into your grub.cfg;

    insmod png

    background_image=/boot/grub/images/myimage.png

    Or if you prefer a jpg

    insmod jpg

    background_image=/boot/grub/images/myimage.jpg

    There are more modules for graphics as well. There is even a play module and a play file load command that will supposedly play a tune. Those are all the details I have about the module right now and I wasn't able to get it to work with an mp3 though a wave file might very well do.

    The ability to load modules like this is outstanding and even though the setup of the grub.cfg file looks different and may be tedious to learn at first, It is superior to the old menu.lst setup. If not just for it's much shorter size though also for the bash scripting design and better syntax.

    I will lead you to this simple guide about many things to configure in grub2 including the background image and font which is needed first to load a grub2 graphical theme.

    http://en.gentoo-wiki.com/wiki/Grub2

    Also..

    http://wiki.archlinux.org/index.php/GRUB2

    If on Ubuntu/Debian the steps are different;

    https://wiki.ubuntu.com/Grub2#Theming

    This guide is intended to move away from the more well known Ubuntu howtos and give insight into what will work on any Linux distro though there is still some good information in the above link and is why I included it.

    Now, even though Grub2 isn't installed on the mbr we can still call the core.img it created in /boot/grub/ along with any modules as well. Which is great because it requires less space and less hidden partition headache.

    The Grub4Dos entry to load Grub2 in menu.lst is;

    root (hd0,0)

    kernel /boot/grub/core.img

    or

    uuid dev-uuid

    kernel /boot/grub/core.img

    You can find the uuid of your usb device using /sbin/blkid

    Also make sure (hd0,0) actually corresponds to your disk and partition and remember that it's +1 now on the partition part in grub2 where as grub4dos still uses 0.

    I actually just removed the root line totally so that only the kernel line was visible and it boots fine.

    The grub2 menu will load and the command line is available with all the neat new modules and tools.

    Here is my example menu.lst (actually UBCD's main.lst that menu.lst points to); Are you confused yet? You won't be.

    You can see where I have an entry to load Grub2's core.img at the bottom of the file.

    http://www.pastey.net/131454

    Also here is my grub.cfg Grub2 uses;

    http://www.pastey.net/132210-4aw0

    Yes I love BackTrack 4 as much as the next person though I chose to use the recently released 2009 Pentoo distro because it has every thing I use anyway (including metasploit) and it's smaller size was ideal for my goal here (plus I like the E17 wm it includes). If you chose BT4 there are many guides available for this already.

    The Slitaz I use is my own customized rescue distro. I built it and removed Parted Magic from my usb because Slitaz has everything I need installed including gparted, and many other rescue tools and the iso only comes to under 35MB. I didn't need the extra programs pmagic includes because they were superfluous. Slitaz is a very easy to customize distro that's perfect for usb and they even include the tools to make updating the entire distro easy.

    Others you will notice are;

    Linux Live Gamer DVD (I have actually removed this one because of it's size. It is nice and does work well if you can fit it.)

    Kaspersky Rescue Disk (another invaluable tool located here; http://devbuilds.kaspersky-labs.com/devbuilds/RescueDisk10/)

    Linux Mint 8 Live

    Slackware Bootdisk + Install Files

    Tinycore (It's another cool distro that is easily upgraded, boots into ram, and it's only 10 meg with a full Xvesa graphical environment!)

    VirtualBox USB Testing on Linux Host

    This has been made into a separate topic and can be found here;

    http://hak5.org/forums/index.php?showtopic=15664

    If you find a real error in any of the above information, please let me know.

    Other very !great sites with information:

    http://grub.enbug.org/CommandList |

    http://www.dedoimedo.com/computers/grub-2.html

    http://multidistro.com |

    http://multidistro.com/wiki/wiki.html |

    http://grub.enbug.org/FranklinPiat/grub.cfg.manpage |

  13. Instead of going through the fifty steps in coedshowers' post you could just reset the bios by issuing the following commands in order if you have access to the DOS prompt and/or able to boot using FreeDOS;

    debug

    o 70 2E

    o 71 FF

    quit

    "In this method we are using the Debug tool of MS DOS. The "O" character present at first in these commands, outputs the values to IO ports. The number 70 and 71 are port numbers which are used to access CMOS memory. By providing FF value we are telling CMOS that there is an invalid checksum and it resets the CMOS settings as well as BIOS password."

    I've had to use that trick before.

×
×
  • Create New...