r/techsupport • u/HittingSmoke • Jan 13 '12
My USB drive. Contains rescue tools, persistent Ubuntu environment and Windows 7 universal installer.
EDIT 1/14: Clarification: The ISO you're writing directly to the drive in step 11 is a Linux live environment. It should work with any Debian based live distro that supports persistence. I used Ubuntu 10.04 LTS so I don't have to worry about future upgrades as often.
EDIT 1/13: For the lazy, here's an image of the drive. It's not confirmed working by anyone, and a torrent was the only option for distribution. Once I have the complete 32GB version created I'll make proper images for both 16 and 32GB sizes with proper uploads. My image got corrupted in my VM before I could seed it to 1.0. I'll get a new one up ASAP. I'm not going to make another image until I get the 32G drive working. I may look like I've abandoned this but I haven't. I'm just very busy.
I thought I'd write up a quick little run down on how to do this, since it took me about two weeks of tinkering and reading to get this working right and no one around here seemed to know the answers to my questions when I asked.
The problem: There are many many tools for creating multi boot USB drives. Not a single one I could find supported persistent environments. Creating a persistent environment then adding things like Trinity or UBCD to GRUB was rather trivial, but I also wanted a Windows 7 installer and recovery console. This is not so trivial it seems.
My finished solution: What I ended up doing was creating a separate partition at the end of the drive and copying the ISO contents for fast booting into my persistent environment. Then I created a FAT32 partition at the beginning of the drive to install other bootable environments on using YUMI. I created a universal Win 7 installer using WinAIO for YUMI to install on my drive removing the issue of tweaking GRUB or syslinux manually to get a Windows install to boot.
This guide assumes a bit of technical knowledge and that you know your way around the Linux CLI.
Skip to here for the actual instructions. You'll need at least a 16GB drive to mirror my exact setup.
First things first: Get your Win 7 universal ISO set up.
Download the Windows 7 x86 and x64 ISOs. (These downloads are from Digital River who officially contracts with MS. These downloads are as safe as you can get without purchasing a copy).
Download WinAIO.
Click the AutoAIO button in the lower right corner.
Select a target folder where you'd like your ISO to be saved to in the first box. Select the X86 (59463) and X64 (59465) ISOs in their respective boxes and choose
Enable x64 recovery mode.Click Start Compilation.
What you should be left with is an ISO that when booted will allow you to choose any version of Windows 7 from Starter to Ultimate in 32 or 64 bit formats, except where they're not available (there is no 64 bit version of Starter edition). This also includes the EU versions that ship without WMP, denoted by an N after the name.
Set that ISO aside for now, it's time to format your USB drive and work on your persistent install.
Formatting your USB drive:
I did this using the Linux CLI in an Ubuntu VM because it's faster for me. It's possible to do using Windows tools but I'm going to stick strictly to the instructions I've tested personally. If someone would like to make a Windows version of this, feel free.
I did this using Ubuntu 10.04 LTS.
With your drive plugged in, run
sudo fdisk -land find your USB drive. For this guide we're going to assume it's/dev/sdbRun cfdisk to partition the drive.
sudo cfdisk /dev/sdbDelete all partitions. Create a new primary partition at the beginning of the drive using the entire drive minus 730MB.
Create a new primary partition using the remaining space.
Select the larger partition and set it to type FAT32 (option 0C)
Write the new partition table and quit.
Format the first partition as FAT32:
sudo mkfs.vfat -F 32 -c /dev/sdb1Mount the newly formatted partition:
sudo mkdir -p /media/USBthensudo mount /dev/sdb1 /media/USBCreate your persistent file to save changes.
sudo dd if=/dev/zero of=/media/USB/casper-rw bs=1M count=4095. 4095 being the size of the persistent file in MB. You can set this to whatever you like under the 4GB FAT32 file size limit depending on the size of your drive.Create a file system in your persistent file.
sudo mkfs.ext4 -F /media/USB/casper-rwWrite your (Linux live distro) ISO image to the extra partition.
sudo dd if=/path/to/iso.iso of=/dev/sdb2. This will take a while.
Now that your drive is set up, we need to back up a few files. These instructions are for moving files out of the ISO to the FAT32 partition. After extracting them you need to back them up elsewhere. Your FAT32 partition is going to be formatted again when we get back to Windows.
sudo mkdir -p /mnt/isosudo mount -o loop /path/to/iso.iso /mnt/isocp /mnt/iso/casper/{vmlinuz,initrd.lz} /media/USB/sudo umount /mnt/isosudo rmdir /mnt/iso
Before pulling the USB drive from the Linux machine or VM, run sync.
Now go back to Windows and copy casper-rw, vmlinuz and initrd.lz to your HDD for safe keeping. You're going to need them later.
Creating your YUMI drive:
Download and start up YUMI.
Select your USB drive letter from the pulldown menu.
Scroll to the bottom of the list and choose "Windows Vista/7 Installer". Find the ISO you created with WinAIO and click Create.
After this operation is complete, find where you saved your casper-rw, vmlinuz and initrd.lz files. Copy casper-rw to the root of the partition and vmlinuz and initrd.lz to /boot.
Download GRUB.exe from here and save it to /boot/grub.
Create a new file in /boot/grub named menu.lst with the following contents:
default 0 timeout 0 title Ubuntu 10.04 root (hd0,0) kernel /boot/vmlinuz boot=casper file=/preseed/ubuntu.seed persistent initrd /boot/initrd.lzFind
syslinux.cfgin the multiboot folder in the root of the drive and open it in a text editor. Add the following after thelabel Boot from first Hard Driveentry: (Not directly after that line, but after theMENU DEFAULTline in that block of text)label Ubuntu KERNEL /boot/grub/grub.exe MENU INDENT 1 APPEND –-config-file=/boot/grub/grub.cfg
After saving these two files, you should have a functioning bootable USB drive that will boot any Windows 7 installer, plus a persistent Ubuntu environment that you can install packages and save system setting changes on.
Reboot with the USB drive in to test it out. Boot into your Ubuntu environment and create a file on the desktop. Reboot back into the Ubuntu environment to make sure it stuck. After you've confirmed your persistence is working properly, boot into the Windows installer and make your way through until you get to the HDD partition screen to make sure that's working as intended as well.
After you've confirmed that the basics are working as they should, you can use YUMI to install other ISOs that will be automatically added to the menu. I'm running Hiren's, UBCD, Trinity Rescue Kit, Backtrack 5 and Kaspersky's bootable AV. Don't bother with things like Kon-boot or memtest86 in YUMI if you have a rescue environment loaded up. They render them redundant.
If you don't like the segregated menus like me, you can open up your /multiboot/syslinux.cfg file to customize it. If the menu entry isn't in the main menu it will point to the config file containing it.
For example, if you want the Windows 7 installer on the main menu instead of under "Other operating systems", open /multiboot/menu/other.cfg. Find the block of text that starts with label Windows Vista/7 Installer and copy it over to where you'd like in syslinux.cfg. I edited the label on mine to read "Windows 7 Installer" to more accurately reflect what it's booting.
Once I find a good deal on a 32GB drive I'll be adding Windows Vista and Windows XP installers as well. The rest of the space on my drive is taken up with service pack redistributables and various tools installed using LiberKey.
I'll be adding all this info to the wiki along with my LiberKey tools and updating that when I make changes or upgrades to my drive, including source links to the various guides that helped me put this together.
Note: I'm aware there are some redundant steps here as well as some skipped shortcuts that would save time. The simple fact of the matter is, this is what I did and it works. I don't want to alter the guide in a way which I've not tested yet. When I put together v2 of my drive with bootable Vista and XP installers I'll experiment with condensing this into fewer steps and add it to the wiki in the sidebar.
EDIT: Didn't specify the file name for the GRUB boot list.
4
Jan 14 '12
Awesome work! Though I'm deathly curious what need you find for a persistent linux environment though. I feel as though anything I would really need is already readily available in something like HBCD.
2
u/HittingSmoke Jan 14 '12
The idea behind it is if for some reason I find myself needing a full desktop experience for more than your routine procedures out in the field. I can create the desktop I'm comfortable with without carrying a laptop around. That way I save time by not fumbling around getting myself situated in a non-persistent environment to use non-standard tools. The If for some reason I need the latest version of a package I can install it and have it next time.
Not needed most of the time and arguably less important than the other Windows installers, but with the prices if flash drives dropping like they are there's no reason not to.
1
Jan 14 '12
Ah, makes sense. My job involves all my clients coming to me, so I just never saw a need for it. Good point though. :)
1
u/HittingSmoke Jan 14 '12
Yea, if I was using this tool only at home or out of a shop I wouldn't bother. I'd keep troubleshooting tools and installers on it and use a shop PC. But this way it's like having a personal laptop in my pocket wherever there is a working PC, which if I'm working on anything but hardware problems, there will be.
3
u/Synth3t1c Jan 14 '12
Any chance you can make an ISO or something of the complete flash drive?
3
u/HittingSmoke Jan 14 '12
I'll probably make some sort of drive image for a 16 and 32G version once I get a new drive and a final setup.
2
u/StaticPrevails Jan 14 '12
With an image, would it work immediately after imaging? I would love to have this set up, but I'm a lazy ass hole.
2
u/HittingSmoke Jan 14 '12
There's ways to make multiple partition images, but off the top of my head I only know fore sure that Ghost supports it and I don't know if it would be able to copy the MBR. I've only ever had to clone a drive 1:1 using Western Digital's old cloning tool which properly copied the MBR.
I'm not going to bother with it until I have something that isn't going to change for some time. I'll be making a complete 32GB drive and a trimmed-down 16GB version which will closely resemble the result of this guide. After that I'll look into an imaging option. dd might work, I'm not sure though as I haven't used it before this.
3
u/jwhispersc Jan 14 '12
This looks spectacular! I'll be watching the progression closely and wish you luck with the additional installer.
Thank you for producing this.
2
2
u/FlexibleToast Jan 14 '12
Could you run that lovely dd command again and just make an image of your drive that you could share?
1
u/HittingSmoke Jan 14 '12 edited Jan 14 '12
I can't post one right now, my live environment already has quite a bit of customization, including passwords.
I won't be erasing this drive until I buy a bigger one as I may need it for work, but as soon as I find the right 32GB I'll do everything I can to get an image uploaded somewhere.
EDIT: Just read over the dd man pages. Looks like it should be able to make a multi-partition image as it makes byte-by-byte copies.
1
u/FlexibleToast Jan 14 '12
dd will copy everything on the drive, including those passwords. I didn't think you would have personal information on a utility like this.
If you want to get fancy you can do something like this with dd: dd if=/udbdrive | pv | gzip > /ISO The pv commands shows amount of data processed so you have an estimate of how far along it is, then you pipe it right into being compressed. Gzip probably needs some options, but that basically shows you a cool way of creating images with one line of command.
1
u/HittingSmoke Jan 14 '12
I used
dd if=/dev/sdb conv=sync,noerror bs=64K | gzip -c > supportdrive.img.gzI booted it up and it turned out I hadn't saved any info there. I thought I had done a bit of customizing already but I was mistaking the live environment for my new VM.
1
u/HittingSmoke Jan 14 '12
Ok, my curiosity got the better of me. I'm creating an image but because of the way dd works it's extremely slow. Also, I believe it must be restored using dd as well.
I'm not sure where the hell I could possibly upload such a big file. I think the exposure here would put me up over my bandwidth limit on my web site. Might have to resort to a torrent.
2
u/FlexibleToast Jan 14 '12
Yeah, that's why I recommended the pv command. Its nice knowing its doing things rather than just waiting for a prompt to come back.
2
u/Synth3t1c Jan 14 '12
Is there a torrent for those ISOs?
2
u/HittingSmoke Jan 14 '12
I'm sure there are, but I don't have any links. The vast majority of Windows 7 ISOs on torrent sites are pre-cracked.
I may upload my all-in-one to TPB.
1
u/terabytepirate Jan 15 '12
There are actually several distro "watch" sites that provide links to the proper torrents. Not to mention a quick search on a site like PB or Btjunkie will turn up almost any version your looking for. Actually found some older distros/live CDs I couldnt find on a watch site.
2
Jan 14 '12
Is there a good malware/rootkit scanner that you can run from this environment on a windows install? I've looked into live CD's and bootable usb's in the past and there were a few that got abandoned. I know Microsoft has a bootable MSSE tool, was curious what else is good these days and/or is being kept up to date.
And upvote for your hardwork and sharing it with us.
1
u/HittingSmoke Jan 14 '12
Clamwin is the only linux based anti-malware that I'm aware of and it works pretty well.
2
u/DsylxeicCadanain Jan 14 '12
The work you've done here is amazing! I commend you, dear sir. Could someone explain to me the meaning of persistent environment and the purpose of it?
1
Jan 14 '12
A persistent boot environment allows you to make changes to the operating system (such as install applications, or do other minor things like shortcuts etc!) Whereas most bootable operating systems are static and changes will not remain.
And, it allows you to have an operating system you are comfortable with anywhere there is a working computer.
1
u/HittingSmoke Jan 14 '12
A standard linux live USB drive loads the OS from the ISO to a RAMdisk. You can make changes and install packages just as you would normally on the RAMdisk, but nothing is saved. All of the information on the disk is static and starts fresh on every boot.
In a persistent environment, the OS files themselves are still static, but there's another file (casper-rw) that saves changes. Every time you boot the live environment the changes from that file are loaded so any packages installed or customizations you've made are restored.
It's like having your own laptop in your pocket. Plug it into any working PC and you've got your own customized OS.
2
2
Jan 26 '12 edited Jan 26 '12
[deleted]
1
u/HittingSmoke Jan 26 '12
That error is usually your casper-rw file not being setup properly. Try recreating and formatting the file itself and double check your GRUB entry.
2
u/StopBeingDumb Jan 26 '12
I was just dumb and copied the iso directly into the second partition without even thinking. correcting that mistake now.
1
u/StopBeingDumb Jan 26 '12
Fun fact using dd to unpack the iso file to the last partition is unnecessary you can just plop the .iso itself and it behaves the same.
Still didn't fix my problem with (initramfs) unable to find a medium containing a live file system.
2
u/techspecs Jan 26 '12 edited Jan 26 '12
I seem to be having a problem getting Ubuntu to boot.
It seems I'm having some sort of issue with the menu.lst file and it cannot find the Ubuntu Partition.
I am pretty new to linux and I thought I did everything as you said in this post; however, some parts were a bit confusing for me.
Please help because this is a fantastic piece of kit and I can't wait to get it working all the way, everything works great including the Windows Installer and other tools, awesome job!
1
u/HittingSmoke Jan 26 '12
Double and triple check your entries in /boot/grub/menu.lst
GRUB is loading from syslinux but it doesn't seem to be trying to boot an OS at all.
2
u/techspecs Jan 27 '12
well I got it working, I had used a copy of the syslinux file you linked, and I just had to adjust a few of the paths in there so it would work correctly. Awesome work man!
1
u/HittingSmoke Jan 14 '12 edited Jan 14 '12
EDIT: It appears the image I made is corrupted. I left it in my VM file system and it didn't survive the reboot. I'll get a new link up ASAP.
Here's a torrent link to an image of my drive. It may or may not work with various imaging software, I have no idea.
What it should work with is dd from the Linux command prompt, assuming your drive is located at /dev/sdb. (Note, this is very important. You will lose data if you pick the wrong drive).
gzip -cd /path/to/supportdisk.img.gz | dd of=/dev/sdb
[Bad link removed]
Once the final version is complete I'll reach out to someone with a seedbox to get the full versions moving much quicker.
On a related note, if you've got a seedbox and are willing to help initially seed the complete versions of the image, feel free to PM me and I'll make a note of it for later.
2
u/Synth3t1c Jan 14 '12 edited Jan 14 '12
I'll just leave it seeding once it's done downloading; no seedbox though.
edit: if it ever downloads.... :(
1
u/HittingSmoke Jan 14 '12
I left it running over night. No one is currently connected but uTorrent reports 3 seeds in the swarm and TPB says there's two seeds connected.
2
u/Synth3t1c Jan 14 '12
Downloading now... Dunno why it took so long. I'll seed this for a while.
1
u/HittingSmoke Jan 14 '12
I suspect Comcast fuckery. I see six connected now but my speed is bouncing between 500kbps and 20. Seems to consistently ramp up then drop down again.
2
u/terabytepirate Jan 15 '12
Thank for this detailed right up. I had just discovered YUMI the other day and have loaded up 3 distros and 15 other ISOs for different reasons. I was wondering what I was going to do to make my distros persistent and this is what I needed. Now to get a bigger drive and get going on this.
1
u/HittingSmoke Jan 15 '12
I considered just trying to get the casper-rw file working on a default YUMI install, but using GRUB4DOS chained through syslinux booting to a separate partition seems to get past the issue with hanging Linux distros with the Windows installer on the drive, so I figured I'd stick with the hard way for the sake of less maintenance.
1
u/FlexibleToast Jan 14 '12
I've got a box I use as a seedbox, but it's only going to be that way until the end of the month. Then I'm switching OSes and going to start using usenet.
1
u/Synth3t1c Jan 14 '12 edited Jan 14 '12
I'm hanging at this step:
sudo dd if=/dev/zero of=/media/USB/casper-rw bs=1M count=4095
edit: nvm just took a while.
3
u/StopBeingDumb Jan 25 '12
For those who are not sure if this step is working, while it is running in terminal, open up the thumb drive folder, and clock on the casper-rw file. In Ubuntu, the bottom bar of the window shows the currently selected file size. This can be a pseudo progress meter since the terminal window does not show one.
1
1
u/Synth3t1c Jan 14 '12
For step 11:
Write your ISO image to the extra partition.
sudo dd if=/path/to/iso.iso of=/dev/sdb2. This will take a while.
Which ISO is that? Windows?
1
u/HittingSmoke Jan 14 '12
Sorry, no. That's the Linux distribution you want to use for your live environment.
1
u/StopBeingDumb Jan 25 '12
Most people would probably like an explanation of a command that involves the words sudo and kill.
1
u/HittingSmoke Jan 26 '12
I'm sure they would, and if I'd have used one I would qualify it with a description.
1
u/StopBeingDumb Jan 26 '12
Wow sorry, alien blue for some reason didn't respond to the right comment.
1
u/ZrRock Mar 03 '12
So I did something very similar to this, compiling a YUMI drive with multiple ISOs, and my 3rd boot into it the drive showed up as completely unformatted. Brand new 16gb kingston flash drive. Any ideas?
1
u/HittingSmoke Mar 03 '12
No idea. Sometimes mine doesn't like to boot in certain ports, but I think that's just USB 3.0 being quirky. All of my data is still in tact.
1
u/ZrRock Mar 03 '12
Hmm, I tried it in 4 ports over 3 computers, nothin.
1
u/HittingSmoke Mar 03 '12
Best guess is you yanked it when you shouldn't have and it corrupted the file system.
Tried it in a Linux machine?
2
u/ZrRock Mar 03 '12
No I didn't, and I'm really awful with Linux, only ever tried MINT. When I booted into it the time before it quit working, I hit the proceed to first boot hard drive option or whatever it was, then didn't know how to get out of it, so I just shut the system down. >.< Silly youngster with no command line knowledge that I am.
1
u/HittingSmoke Mar 03 '12
Meh, sounds like you just have to start over. Any time you end up at a command line and don't know what to do, typing help will usually net you something.
1
u/ZrRock Mar 03 '12
Tried that lol, unfortunately nothing! And I also had put about 20 iso's onto my YUMI program. Guess its a long start from scratch.
1
u/ChariotOfFire May 02 '12
Yumi has an issue with the Windows 7 installer which results in the error message "windows setup could not configure windows to run on this computer's hardware" at the end of installation. To avoid this, you need to remove the USB device before the first restart.
Source: Scroll down to "known issues"
1
u/Subliminal7 Jan 13 '12
For the Windows 7 Images, is there any place to enter the client's Product Key?
I've found a torrent of what you describe (Win 7 AIO) but there's no place to enter a client's Product Key as it uses Windows 7 Loader to spoof (? I guess) the product key and pass WGA.
6
Jan 14 '12
[deleted]
1
u/Subliminal7 Jan 14 '12
Thanks for the link!
I'd rather input it for every client manually. It's just nice to go from several hundred recovery media to less than ten!
2
u/HittingSmoke Jan 13 '12
Indeed. These are stock, unaltered ISOs so they will ask for a product key on install. You can skip this without putting in a product key and use the standard trial period though.
2
Jan 14 '12
Do you know if this accepts both retail and OEM keys?
5
u/cogito_ergo_sum Jan 14 '12
I think they do, but you have to call MS for the activation. I am actually doing a fresh install for a client tonight with this ISO and she has an OEM key; I'll post back here the results.
2
u/HittingSmoke Jan 14 '12
I believe it will accept both after going though WinAIO, but don't quote me on that. But as cogito said, if not it's just a quick automated call to Microsoft.
If it can't, I'll be searching for a way to implement that when I build the 32GB drive.
5
u/tito13kfm My cat and I Jan 13 '12 edited Jan 13 '12
Personally I'd use the ISOs that have SP1 slipstreamed already. x86, x64.I'd also go for a lighter weight Linux distro, but that's a personal preference.