VectorLinux
September 18, 2014, 01:30:43 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: HOWTO: USB Bootable Install Drive/Stick  (Read 5860 times)
J-Flo
Member
*
Posts: 4


« on: August 22, 2011, 12:24:43 pm »

PURPOSE:
This will allow you to create a USB Bootable installation stick. The drive will retain the ability to be used as a standard USB stick as well (ie: it will still work under a mac/windows/*nix) while focusing on doing it efficiently while maintainga reasonable level of "user friendliness".

HISTORY:
I found myself in the position of not being able to burn a reliable ISO of Vector 6.0 Light to a CD but I needed install VL on some other machines I had lying around. After some trial and error this is what I came up with. It works wonderfully for me and I hope it does for you as well should the need arise. I have not tested these with any other Vector versions... but it should work for them (at least theoretically).

UPDATE: 9/20/11.  VL 6.0 KDE Classic ISO instructions as well as Light.

UPDATE: 1/27/12 Fixed some errors. New instructions on VL 7.0 STANDARD install.

REQUIREMENTS:

* Recommended 2+ GB Standard USB Drive
* BIOS access to a PC/Mac that supports bootable USB devices
* root on a working Linux box
* ISO image of Vector Linux

First things first. Make sure you have a PC/MAC that can boot from USB Hard Disks and that it is in fact set up to boot from them before your hard disks.

VERSION: ALL
Insert your flash drive and let's begin. After inserting the drive you may want to check it mounted correctly with df -hT. This is also good for scouting your device name for the USB device. Mine was /dev/sdb. Unmount any/all partitions from the USB device.

Use cfdisk or fdisk to create a primary Win95 LBA partition ( code 0C ).  Subtract these suggested partition sizes to follow from your total space that cfdisk reports. Also make sure that you make set the BOOT flag for this partition.

VERSION: VL 6 KDE Classic
720 MB
VERSION: VL 6 Lite
700 MB
VERSION: VL 7.0 STANDARD
735 MB

VERSION: ALL
Create a second Win95 LBA primary partition with the remainder of space. Write the partition table and Quit cfdisk.

VERSION: ALL
dd if=[ PATH TO VECTOR ISO ] of= [ DEVICE PATH TO SMALL PARTITION ]
EXAMPLE:
dd if=~/VL6.0-Light-Final.iso of=/dev/sdb2
NOTES:
This writes the iso9660 image of Vector to our smaller partition. The partition still remains a 0C to cfdisk... but is mounted as iso9660 in Linux as a working CD. Each version has it's own LABEL for the "CD." Please be aware of this as you will need to make note of the one you are installing as it will become part of the commands you issue.

VERSION: ALL
Now we prep the other partition for usage. It is a good idea to LABEL the large partition.
mkfs.vfat -vn [ DISK NAME ] [ DEVICE NAME TO LARGE PARTITION ]
EXAMPLE:
mkfs.vfat -vn VBOOT /dev/sdb1
NOTES:
This should create a healthy FAT32 file system for portability. At this point you should check to see if any partitions from your USB device have been mounted. Note that VBOOT is my label I used. It is up to you what you choose but make note of it. Also make note of the CD Label (VL-LIGHT, VL-KDE3 etc). unmount any USB mounts. Remove the USB stick and plug it back in. I know it sounds redundant but trust me.

From the shell: df -hT

At this point you should see TWO new partitions in /mnt/vl-hot. One will be an iso9660 type and the other is one of your choosing. For the sake of instruction I will use my example of VBOOT from here on out. If you used a different label then substitute when needed.

VERSION: ALL
We have to prep the large partition with some data from the CD Image...
EXECUTE:
cp -vr /mnt/vl-hot-VL-LIGHT/*s*linux /mnt/vl-hot/VBOOT

VERSION: 6.x
EXECUTE
cp /mnt/vl-hot/VBOOT/isolinux/initrd.bin /mnt/vl-hot/VBOOT/isolinux/init.gz
EXECUTE:
cd /mnt/vl-hot/[ CD IMAGE NAME ]/syslinux

VERSION: 7.x
We must now edit the syslinux.cfg file.
EXECUTE:
vim /mnt/vl-hot/VBOOT/syslinux.cfg
NOTES:
The use of vim is subjective. If you use emacs, pico, elvis etc that is fine. Your goal is to replace 2 instances of init.gz with initrd.lz
Also near the end you should replace an instance of initrd.img with initrd.lz. Save the file and exit the editor.
EXECUTE:
cd /mnt/vl-hot/[ CD IMAGE NAME ]/syslinux

WARNING WARNING WARNING!
TYPOS BEYOND THIS POINT WILL FORCE YOU TO START OVER!
ALL COMMANDS ISSUED BEYOND THIS POINT ARE REQUIRED FOR ALL VERSIONS OF VL INSTALLS

It's time to prepare the USB stick to be bootable! These commands come from the bootinst.sh script that is on the root directory of the CD. However this script ( as is ) does not meet our needs. Unfortunately I'm a horrible shell script hacker... so I had to extract and use manual commands.

EXECUTE:
lilo -S /dev/null -M [ DEV NAME OF USB ] ext
EXAMPLE:
lilo -S /dev/null -M /dev/sdb ext

EXECUTE:
lilo -S /dev/null -A [ DEV NAME OF USB ] [ NUMERICAL NUMBER OF THE LARGE PARTITION ]
EXAMPLE:
lilo -S /dev/null -A /dev/sdb 1

EXECUTE:
cat mbr.bin > [ DEV NAME OF USB ]
EXAMPLE:
cat mbr.bin > /dev/sdb

EXECUTE:
syslinux -d syslinux [ DEV NAME OF THE LARGE PARTITION ]
EXAMPLE:
syslinux -d syslinux /dev/sdb1

You are done! You should now have a bootable USB stick that will allow you to install Vector Linux as well as a functional USB hot swappable storage device. Happy Vectoring!

SPECIAL THANKS:
uelsk8s : clearing up questions about initrd
pierce.jason : for validating and appreciation of the project


« Last Edit: January 27, 2012, 04:55:40 pm by J-Flo » Logged
pierce.jason
Packager
Vectorite
****
Posts: 250



« Reply #1 on: December 26, 2011, 11:28:10 pm »

We need to get an update to this, for VL7.0 GG Gold and Live
Logged

pierce.jason
Email: $(echo -e "moc\x2eliamg\x40nosaj.ecreip" | rev)
J-Flo
Member
*
Posts: 4


« Reply #2 on: January 20, 2012, 12:22:28 pm »

I'll get to work on this now. I can't promise any results... but at least the community here knows I'm on it. I didn't really think this was proving useful so I haven't worked on the other releases.
Logged
pierce.jason
Packager
Vectorite
****
Posts: 250



« Reply #3 on: January 23, 2012, 08:32:35 pm »

Great to hear, Thanks J-Flo!
Logged

pierce.jason
Email: $(echo -e "moc\x2eliamg\x40nosaj.ecreip" | rev)
J-Flo
Member
*
Posts: 4


« Reply #4 on: January 26, 2012, 06:52:16 pm »

So far my attempts to create a bootable USB stick for VL 7 has proven very problematic.

The first issue I came across is that there is no initrd.img file on the cd that I could find. There is no documentation on the disk to tell me what if any is the new file to be used as the ramdisk image.

I tried the next logical thing I could think of and used and older initrd.img file.
This actually worked sort of.

I was able to boot up into 7.0's setup. However when it tries to install it gives me a rather odd and verbose error. Something to the effect that it can not find an install media on a hard disk or CDROM. It then goes on to inform me that I must be using "an advanced piece of technology the author must not could afford."

I assure you my $9.99 Scandisk USB drive is not advanced... nor is it unaffordable. Also it worked fine with your last version!

You would think that this error would occur only if it is unable to find the device or partition. Not the case. Upon exiting to the shell I was able to see my HD and USB with probedisk and my partitions with probepart. I could even MOUNT THEM!

Maybe its on me somehow. I don't think so though. I think they made some major changes to the setup from 6 to 7 (prob to accommodate the new /veclinux and ISO installs ) and maybe broke something with installing from win95 partitions.

I can't help but think that if the would have allowed you to manually provide a source instead of relying solely on auto detection.... this would be easy to work around.

However the only way I see of doing this now is to somehow fake a dos startup disk and use loadlin. This is beyond my scope of knowledge... so I guess this leaves you guys in the lurch. Unless the developers weigh in here and help out.
Logged
uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« Reply #5 on: January 26, 2012, 09:52:18 pm »

the "initrd.img" file is isolinux/init.lz in 7.0

The setup that you loaded was from the 6.0 initrd.img. It does not understand the new format of the 7.0 ISO and wouldn't be able to install from it if you manually pointed to it.


HTH,
Uelsk8s
Logged
J-Flo
Member
*
Posts: 4


« Reply #6 on: January 27, 2012, 05:05:42 pm »

the "initrd.img" file is isolinux/init.lz in 7.0

The setup that you loaded was from the 6.0 initrd.img. It does not understand the new format of the 7.0 ISO and wouldn't be able to install from it if you manually pointed to it.


HTH,
Uelsk8s

Thanks Uelsk8s. What I should have said about the next logical step was to try to find the ramdisk file on the 7.0 ISO. I did try init.lz before trying to use the old 6.x initrd.img. I ran into several problems with this. The machine would get caught in a reboot loop after it would prompt me for a video mode: even when selecting auto detect. The soloution I owe in small part to you for making me take another look at the isolinux dir. There was the initrd.lz I had previously overlooked! I told you guys I wasn't a Linux Pro.  Embarrassed At any rate this solved the problem and the setup was now able to detect the "win95" partition to install from. Many thanks, in some small part you saved the project.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!