Storing and Booting the MBR from True Crypt
I have read some articles here on booting that are way and above better than anything else anywhere else. Kudos to the submitters. I learned a lot, THANKS!
TrueCrypt works by putting a tiny, PRE-BOOT decryption test program in the MBR. This tests the different algorithms with the supplied password and looks for the word TRUE in the Volume Boot Record. (At least in Windblows versions)
For it to be successfully chainloaded, the trueCrypt MBR has to be stored in a partition OTHER than the Windblows partition it is for, loaded as if it were the Volume Boot record, and if Active Flag is correct in the Partition Table (in the stored TrueCrypt MBR?), it will then do it's thing and boot(strap) the encrypted Windblows partition.
So, gurus all, can GRUB boot a stored MBR? The motherboard wouldn't care, I don't think, because the VOLUME BOOT RECORD is written over the MBR in memory, right?
All thoughts ,(expert knowledge, and fearless experimentation), appreciated.
hmmm, I'm missing something...
saikee: Thank you for your amazing and comprehensive tips. I've worked with Unix, Linux and Windoze for years, and am finally starting to learn about Linux boot. What a help. I've been reading a lot of threads here and elsewhere, and thought I was starting to understand some of this. Of course, the first time, things don't seem to work as expected.
Earlier, I created two Puppy Linux LiveUSB sticks under WinXP using Linux Live USB Creator (which I now understand uses syslinux). Both of the sticks worked great, and I have been a happy puppy.
After reading some of your threads on Grub, it seemed like a good thing to try, especially with all the good details. However, as soon as I run grub to setup the loader on one of the USB sticks, it is no longer bootable! I can't figure this out.
I've tried reformatting three times, twice with gparted, and once following your notes using mkdosfs. Nada. The stick is ignored and XP starts up. Both gparted and fdisk show a primary fat32 partition with the boot flag set. I've tried rerunning grub, and even tried using grub-install. Still nada. Wtf am I missing?
aTdHvAaNnKcSe,
Issue resolved: USB recognized as boot device again on PC
Success, finally. In frustration, I dd'd a kilobyte from /dev/zero to the device and rebooted. Got the cryptic message "Boot error". So an error's better than nothing! That lead me to this article and then this page. The fix that worked for me:
Code:
sudo mkdiskimage -F /dev/sdX 0 128 32 # good for my 2GB USB stick
Immediately after this, gparted didn't like the partition. However, after running the Puppy Universal Installer, everything is copacetic once again: gparted is happy, and I can boot from the stick on my PC. Yay, hooray.
six
I hope this saves someone else the 100 or so hours I spent on this (well, seemed like it anyway...in six and a half days, maybe fifteen hours, but still, whadda drag).
Manually create the MBR on a FAT32 USB stick
Ok, not sure if this is the right place to post this and ask these questions - but looking around the net, it appears to be the best I've found...so here goes.
1. Let us assume I have formatted a blank USB stick showing as H: - 1GB, 2, 4, 8 etc. with a fat32 file system, likely to be done in Windows since I haven't got a Linux system yet, and I use the command:
format H: /FS:FAT32
(I happen to have Windows 2000, service pack 4 - this command is ancient - haven't tried it with Vista or 7)
2. Now I have a Linux OS to install on there - for tiny problem and tiny copy, lets use Tiny Core - about 10MB.
Tiny Core likes to be installed in a folder, \TCE off the root. So, I get their files and place them there - primarily
H:\tce\bzImage
and
H:\tce\tinycore.gz
3. Now I've used syslinux, ntldr and grldr, linuxlive (?livelinux?), syslinux etc. - and GRUB
Not quite sure about how this works, but thus far, Grub working on a W2K box has been the most reliable and easy to configure. syslinux seems to "hang" and Lilo? Uh - problems...
So I have
grldr
and
menu.lst
... sitting in a folder on my C: W2K drive - just a "storage" folder -
and I copy them to the USB stick
copy c:\stuff\grldr H:\
copy c:\stuff\menu.lst
4. I use notepad to edit menu.lst and have a basic menu.lst file
timeout=
default=0
title Pocket Rocket Linux
find --set-root /tce/tinycore.gz
kernel /tce/bzImage quiet norestore bkg=splash.jpg desktop=jwm waitusb=15 xvesa=1400x1050x24
initrd /tce/tinycore.gz
...saved as H:\menu.lst
So at the end here I have - in the root
H:\grldr
and
H:\menu.lst
and below that
H:\tce\bzImage
and
H:\tce\tinycore.gz
5. QUESTION: why won't it boot?
It used to (sort of) when I had syslinux working - sometimes booted ok -sometimes hung - but BIOS was capable of seeing it and running. Since it hung half the time I figured I'd use GRUB (grldr and menu.lst) which has been very reliable on the W2K box, installed on C:\grldr and C:\menu.lst
I liked Grub so much I said "To heck with syslinux (hangs) or Lilo or anything else.
6. I have a feeling it has to do with the MBR - master boot record
I have seen answers that say "Go copy this or that file from another Linux CD to the USB drive.
QUESTION: I would like to know if there is anything I could type in NOTEPAD - or even use Perl or quick basic - and write a quickie bit of data - less than 512 bytes - that could tell BIOS to GO RUN GRLDR - which will automatically snag menu.lst and do whatever it wants to do - i.e. use the grub find command and away we go
Basically I want to open notepad or use some "editor" and create the commands (?assembler?) that say "Go run grldr (or something) so the grub parameters are executed.
Is there a method of either doing this manually or somehow getting grub / grldr to run?
Thank you in advance.