From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kj7Im-0008HL-Fj for mharc-grub-devel@gnu.org; Fri, 26 Sep 2008 02:59:44 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kj7Ij-0008GJ-Tx for grub-devel@gnu.org; Fri, 26 Sep 2008 02:59:41 -0400 Received: from [199.232.76.173] (port=32788 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kj7Ij-0008GA-I7 for grub-devel@gnu.org; Fri, 26 Sep 2008 02:59:41 -0400 Received: from mx20.gnu.org ([199.232.41.8]:14894) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kj7Ii-0006FY-Rx for grub-devel@gnu.org; Fri, 26 Sep 2008 02:59:41 -0400 Received: from smtp.aircanopy.net ([66.160.208.25]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kj7Ih-00058n-AL for grub-devel@gnu.org; Fri, 26 Sep 2008 02:59:39 -0400 X-ASG-Debug-ID: 1222412377-72b800000000-Td4drV X-Barracuda-URL: http://66.160.208.25:8000/cgi-bin/mark.cgi Received: from aczmr1.aircanopy.net (aczmr1.aircanopy.net [66.160.208.172]) by smtp.aircanopy.net (Spam Firewall) with ESMTP id 527AE6ADB02 for ; Fri, 26 Sep 2008 01:59:37 -0500 (CDT) Received: from aczmr1.aircanopy.net (aczmr1.aircanopy.net [66.160.208.172]) by smtp.aircanopy.net with ESMTP id ilbAtHFC42zgNxdh for ; Fri, 26 Sep 2008 01:59:37 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by aczmr1.aircanopy.net (Postfix) with ESMTP id 3994C1CC5D for ; Fri, 26 Sep 2008 01:59:37 -0500 (CDT) X-Virus-Scanned: amavisd-new at X-Spam-Score: -2.013 Received: from aczmr1.aircanopy.net ([127.0.0.1]) by localhost (aczmr1.aircanopy.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 93jTHypRhza0 for ; Fri, 26 Sep 2008 01:59:36 -0500 (CDT) Received: from aczmb1.aircanopy.net (aczmb1.aircanopy.net [66.160.208.170]) by aczmr1.aircanopy.net (Postfix) with ESMTP id B17A41C8B0 for ; Fri, 26 Sep 2008 01:59:36 -0500 (CDT) Date: Fri, 26 Sep 2008 01:59:36 -0500 (CDT) From: Andy Goth To: grub-devel@gnu.org Message-ID: <122444512.205871222412376643.JavaMail.root@aczmb1> X-ASG-Orig-Subj: GRUB 1.96 on a USB floppy drive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [66.160.219.98] X-Mailer: Zimbra 5.0.8_GA_2462.SLES10_64 (zclient/5.0.8_GA_2462.SLES10_64) X-Barracuda-Connect: aczmr1.aircanopy.net[66.160.208.172] X-Barracuda-Start-Time: 1222412377 X-Barracuda-Virus-Scanned: by Aircanopy Spam Firewall at aircanopy.net X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.6535 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-detected-kernel: by mx20.gnu.org: Linux 2.4-2.6 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: GRUB 1.96 on a USB floppy drive X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2008 06:59:42 -0000 Hi, I have successfully installed GRUB 1.96 on a USB floppy drive. I used a Knoppix 5.1 bootable CD as my operating system. The floppy shows up as /dev/sdc, which causes GRUB and other programs to believe it to be a hard disk with partitions and such. That causes a number of problems. The first order of business is formatting the floppy. Without the -I option, mkfs.msdos wimps out, saying "Will not try to make filesystem on full-disk device". $ mkfs.msdos -I -F 12 /dev/sdc Next, I mount the disk. $ mount /dev/sdc /media/sdc I then create a device.map to tell GRUB that /dev/sdc is actually a floppy. $ mkdir -p /media/sdc/boot/grub $ echo '(fd0) /dev/sdc' > /media/sdc/boot/grub/device.map Last, I install GRUB on the disk. grub-probe just freezes on this computer, so I bypass it. I add the -v option to grub-setup so that I can confirm that it knows it's writing to a floppy instead of a hard disk. $ grub-install --modules="fat biosdisk" --grub-probe=true \ --grub-setup="/usr/local/sbin/grub-setup -v" \ --root-directory=/media/sdc /dev/sdc Before figuring out the trick with device.map, I used this command line: $ grub-install --modules="fat biosdisk" --grub-probe=true \ --grub-setup="/usr/bin/gdb --args /usr/local/sbin/grub-setup" \ --root-directory=/media/sdc /dev/sdc I set a breakpoint on grub_device_open, allowed it to finish, then forced ->disk->has_partitions on the returned object to be 0. (It's originally set to 128.) (gdb) break grub_device_open (gdb) run (gdb) finish (gdb) print $1->disk->has_partitions = 0 (gdb) continue etc. If I neither write a custom device.map nor set has_partitions to zero, GRUB corrupts the filesystem when it embeds the core image after what it thinks to be the MBR. I suppose I could use the -R option to mkfs.msdos to reserve sectors for it. Sectors are 512 bytes in size, right? That means I'd need to reserve 52 sectors for a 26308-byte core image plus one more for the boot sector. I don't really feel like trying this out, though. Why does grub-probe lock up? Well, when I disable "legacy floppy support" in the BIOS configuration, grub-probe no longer locks up. This computer doesn't actually have a "real" floppy drive. My guess is that it has pins for one buried in the docking station connector. It's probably waiting for me to go buy a docking station with a floppy drive in it. :^) The disk I made boots with both a "real" floppy drive (tested in another computer) and in this USB floppy drive, which I can access using the biosdisk module. The biosdisk module names the USB floppy drive (fd0) and the mystery nonexistent floppy drive (fd1). Accessing (fd1) causes GRUB to lock up. After loading pc.mod, I can also read all the files on my hard disk. However, I can't boot using chainloader. I just get a "disk read error, press Ctrl+Alt+Del" message, regardless of which partition or disk I try to chain to. This happens with both biosdisk.mod and ata.mod. By the way, why does loading ata.mod cause biosdisk.mod to become unloaded or disabled? I lose access to (fd0), (hd0), and others after loading ata.mod. I can't find the parttype, hide, and unhide commands which were present in old GRUB. What happened to them? ata.mod is a real godsend for booting a computer I have with an old BIOS that doesn't support large hard disks. I guess I could repartition so that there's a boot partition right at the beginning of the disk, but at the time I was setting up the machine, I didn't have tools for doing that. Now I just leave a GRUB floppy in the drive all the time. I just have to be careful to load ata.mod last, or else I lose access to (fd0). :^) -- Andy Goth | http://andy.junkdrome.org/ unununium@{aircanopy.net,openverse.com}