This is a modified version of section D) at:
How to install SystemRescueCd on a USB stick
Please see this page for other details.
Also this assumes grub and not grub2 is in use on your system. You most likely will have to modify for a grub2 install. One big difference is that partition numbers in grub2 are "1" based and not "0" based as they are in grub.
One reason for this additional material is that the grub-install method did not work at all for me, I needed to manually run grub. The other is that I wanted most of the USB stick to be usable for transferring files between various devices/OS's - the common file system for such purposes is FAT32.
Unlike Linux, Windows, myopic as it is, can only see the first partition on a USB stick (out of the box). And for added safety I wanted the SystemRescuCD code to reside on a non-Windows usable file-system, in this case ext4. So we make the first partition FAT32, for portability, and the second partition, which Windows doesn't see anyway, ext4.
WARNING - running these commands will destroy data - be absolutely sure you are working with the proper device!
When you see "sde", substitute the "e" with the drive letter of your target device, do not blindly type it in as is. When you see hd4 substitute the "4" with the corresponding 0 based number as e is to 4 (notes below). In my actual system, with 4 hard drives (sda, sdb, sdc, sdd), the flash drive is sde and grub's syntax refers to it as hd4.
Become root or use sudo, whatever your style is.
Prepare (erase) the flash drive by writing all "ones" (not zeroes) to it:
- tr '\000' '\377' < /dev/zero | dd bs=16384 of=/dev/sde
Write a new blank partition table (if your distro's fdisk doesn't turn DOS compatibility mode off, turn it off as well - the "c" command):
- fdisk -H 224 -S 56 /dev/sde
- fdisk -H 224 -S 56 /dev/sde
- (accept default)
- +6500M (~capacity of your stick minus 1500M)
- (accept default)
Make sure your OS sees the new partition layout:
- fdisk -l /dev/sde
Format partition 1:
- mkfs.vfat /dev/sde1
- mkfs.ext4 -O ^has_journal /dev/sde2
- fsck /dev/sde1
- fsck /dev/sde2
- mount -t ext4 /dev/sde2 /media/usbstick
- cp -a /where.your.System.RescueCD.files.are/* /media/usbstick/*
- mkdir -p /media/usbstick/boot/grub
- cp -a /lib/grub/<distro-specific>/* /media/usbstick/boot/grub
title SystemRescueCD 32bit
title SystemRescueCD 64bit
Original page recommends to run:
- grub-install --root-directory=/media/usbstick/ /dev/sde
- **(this did not work for me)
- grub> find /boot/grub/menu.lst (will verify the proper root location)
- grub> root (hd4,1) (specify where your /boot partition resides)
- grub> setup (hd4) (install GRUB in the USB stick's MBR)
- grub> quit
You should now be able to boot into the SystemRescue OS as well as use the first partition for transferring files between various OS's.
Please comment on whether you find this information useful or what might be done to improve it. Thank you!
grub-install --root-directory=/media/usbstick/ /dev/sdeReplyDelete
didn't for me too but
grub-install --recheck --root-directory=/media/usbstick/ /dev/sde
seemed to fix (my) problem
Good to know. Might have worked in my case as well but I prefer the manual method over grub-install which even the docs refer to as "definitely less safe": http://goo.gl/3YoRuReplyDelete
Thanks for this guide, as `grub-install` didn't work for me, too.ReplyDelete
One thing that seems odd to me: you advice running `find /boot/grub/menu.lst`; of course, that's menu.lst on my hard disk, not the one I just placed on my USB device. So I tried `find /mnt/usb/boot/grub/menu.lst`, but that failed (though my device really was mounted there).
After that, I tried your advice (`find /boot/grub/menu.lst`) and Grub responded with (hd1,1), where I would expect it to respond with (hd0,1) (where my /boot resides). Can you elaborate on that?
I already looked at the info pages (`info grub`), but they say:
grub> find /boot/grub/stage1
This will search for the file name `/boot/grub/stage1' and show the devices which contain the file.
Did you miss the step:
Create a menu.lst in /media/usbstick/boot/grub/ ?
just a question: Doesn't the grub hd number change from computer to computer depending on the number of harddrives available? If, so, it will work on MY computer it was created on, but what about others?ReplyDelete
I want a system rescue stick I can boot/use on any computer I want to fix, not just my own, like using the system rescue CD. How do i accomplish this?
Yeah, my Thinkpad 4 yrs old laptop (nc6120 I think) boots from the 2nd ext4 partition.ReplyDelete
Windoze XP installed on that Thinkpad laptop sees and can copy files on 1st vfat partitin.
So, all is well and working... but NOT for my 6 yrs old AT8-32X MBO (Abit) based PC systems.
The MBO must be the reason.
It boots fine (once I talk it into it, a lil' persuasion needed) if I install sysresccd on one vfat partition USB, nothing else on the stick, the easy automated install.
That seems to be what I will have to stick with.
Of course, I am now also looking into a way to have an ext4 partion aside, as 2nd partition on the USB drive, for Linux stuff on the stick, but the booting must, I guess, be from vfat... from the Billy and the Gang's fatty bloaty stuff of their ugly OS grown and spread on ignorance and greed of the world.
So, I guess my mileage to follow now is, regular auto install, the recommended one on the page:
And then, whatever works to get another partition... Shrink vfat first, or what?
I don't know yet... But have an ext3/ext4 partition, as 2nd partiotion on the stick for better things which won't stink of the Corrupting Gang's stuff.
This page was useful. Thanks!
God bless you!
Why the "-H 224 -S 56", though?ReplyDelete
It booted just fine but I'm getting "Cannot find /sysrcd.dat on devices" error message and an incomplete boot that drops me to a mini shell. /sysrcd.dat file is right there in the root. I also tried these instructions with an older version of the iso that I know worked with this particular hardware just fine and it ends up the same way. I guess this guide is missing a step or two.ReplyDelete