Posts: 19
m_pav
Joined: 12 Sep 2007
#1
Testers required for making an antiX M8 bootable thumb drive.

If your computer can boot from a USB thumb drive, then you've got to try this. Antix live from USB running at near hard disk speed and installation in approx 2 minutes for a 2.0ghz older single core CPU. This takes the LiveCD to a new level of operation, making CD and DVD burning fully possible for notebooks and desktops with only 1 optical drive, and did I mention the speed?

Download it from
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.gigasize.com/get.php?d=x109cddqdhb"
linktext was:"http://www.gigasize.com/get.php?d=x109cddqdhb"
====================================


Below are the contents of the included included readme file.

I am looking for the more advanced users familiar with scripting (not just stringing together commands as I have done) to assist with streamlining this process, with a view towards including it on the next antiX release.

----------------------------------------
antiX 8 USB Key

Please read this entire file before commencing to familiarize
yourself with the procedures, and maybe adjust them, or the provided
scripts for your preferred workflow.


PREREQUISITES
Computer with USB 2.0 ports recommended
working internet connection
1Gb or larger Thumb Drive
Partimage


CONTENTS
a8flash.000 Flash disk image containing skeleton of thumb drive
Note - image is set to ~750Mb to accomodate the vast
differences in flash drive sizes and to enable you
to make a data partition should you wish to.
backup script I used to make the image
grub.mbr Flash disk master boot record and partition structure
mkbtfl-sdb script to install to sdb
mkbtfl-sdc script to install to sdc
mkbtfl-sdd script to install to sdd
mkbtfl-sdx editable script for other mount points
README-FIRST This file you are reading


GETTING STARTED
The procedure described in this help file details how to make a
Mepis 8 Bootable thumb drive using the a8flash.000 image provided.

STEP 1
Plug your flash drive into a free USB port, mount the device and
take note of the mount point assigned to the device - e.g. sdb1
Leave it plugged in and mounted, it will be unmounted later by the
script. Alternatively, you can issue the command"dmesg |tail"
and identify the device by looking for the [sdx] where"x" is the
letter you need to remember.

STEP 2
Find the script that matches the mount point for your thumb drive, or
edit the sdx script if a script for your thumb drives mount point is
not provided.

Example:
if your mount point is sdf, change the 6"sdx" references to"sdf"
then save the file.

Note - If you do not already have partimage installed, uncomment the
line by removing the"#" and the white space in front of apt-get

--------------------------------------------------

Code: Select all

#!/bin/sh
 
su -c"umount /dev/sdx*
dd if=/dev/zero of=/dev/sdx bs=512 count=1
dd if=./grub.mbr of=/dev/sdx
dd if=/dev/zero of=/dev/sdx1 bs=512 count=1
# apt-get update && apt-get install partimage
partimage -b restore /dev/sdx1 ./a8flash.000
sfdisk -l /dev/sdx"
--------------------------------------------------

STEP 3
Install partimage if it is not already installed. As root in a terminal,
type the following, or uncomment the line from the script by removing
the"#" and the white space in front of apt-get so it looks like the
example below and let the script install partimage for you.

Code: Select all

apt-get update && apt-get install partimage

STEP 4
Change the script that matches your mount point to make it executable.
hint - in Konqueror, right click file > Properties > Permissions tab,
click on"Is executable", then on OK.
Note - It is helpful and advisable to only have one file marked as
executable to avoid confusion.


STEP 5
Press your F4 key to open a terminal window at the folder you are
viewing and type the name of the file marked as executable, or type
the first few letters as below and press your Tab key to use command
line completion
./mkb (tab)
enter your root password
1) The flash drive will be unmounted.
2) The first 512 bytes of the flash drive will be erased, removing
all boot code and partition tables.
3) A 750Mb partition will be created on the selected flash drive
and grub will be copied to the root of your flash drive
4) Partimage will copy the skeleton image to your flash drive
This takes only a few seconds and you should see the blue
background of the partimage window with a rapidly growing
progress bar.
5) sfdisk will display the new partition layout of your flash drive.
You can safely close the terminal window and remove your newly
created bootable flash drive.

Below is the terminal printout of the process when used on a 2Gb drive
-----------------------------------------------------------------------

Code: Select all

michael@mikepav:~/Backups/ANTIX_BOOT_FLASH$ ./mkbtfl-sdb
Password:
umount: /dev/sdb: not mounted
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.009202 s, 55.6 kB/s
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.0122262 s, 41.9 kB/s
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.0122262 s, 61.3 kB/s

Disk /dev/sdb: 1014 cylinders, 63 heads, 62 sectors/track
Units = cylinders of 1999872 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdb1   *      0+    392     393-    767498    6  FAT16
/dev/sdb2          0       -       0          0    0  Empty
/dev/sdb3          0       -       0          0    0  Empty
/dev/sdb4          0       -       0          0    0  Empty
-----------------------------------------------------------------------

STEP 6
Unplug the flash drive, wait a few seconds and plug it back in, then
mount it. The drive will have a new name, ANTIX-BOOT

STEP 7
Delete the empty"antiX.iso" blank file from the flash drive and copy
any antiX iso CD-ROM image to the root of your flash drive.
When finished, unmount your flash drive.

STEP 8
Open Gparted, select your flash drive and resize the partition as you see fit.

CONGRATULATIONS
That's it, your flash drive is ready to go.

Mike P
Posts: 903
plvera
Joined: 11 Oct 2008
#2
m_pav:
thanks for this. I was looking for a way to do this so that I could try antix in one my kids laptops. I doubt that I meet the specs of an advanced user, but I'm willing to try it tonight. I'll let you know how it goes.
Best regards,
Pedro
Posts: 316
DJiNN
Joined: 26 Oct 2007
#3
Great idea, and one that i shall be trying once i get hold of a few small (2gb approx) USB sticks to play around with.

Do you know how/if this affects the ultimate life of the USB stick? USB sticks do have a finite READ/WRITE amount before they start to fail, and although that's probably quite a high number (in the millions) running an OS from a USB stick will result on more than an average amount of READ/WRITES i would have thought?

Still gonna give it a try though, and antiX on a USB key sounds really cool! __{{emoticon}}__
Posts: 903
plvera
Joined: 11 Oct 2008
#4
m_pav:

A question. When you say copy the iso file to the usb stick, you mean really just copy? as in cp or use file manager? not burn? my brasero (or k3b for that matter) are unable to burn directly to usb. Yet I thought that iso files are compressed images with an architecture that's properly revealed and set up after a burn.

Anyway, I hope it's just plain copy since that would be easy.
thanks.
Pedro
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#5
Yes, just copy the iso file over using rox or whatever you prefer.
Posts: 19
m_pav
Joined: 12 Sep 2007
#6
djinn, the resulting bootable thumb drive will be like a read-only CD, not a hard disk install, so writing will be minimal and reading will be the most common form of access.

After building your USB key, you can shrink the first partition to the smallest size it will go because it is read-only, and make a second partition to fill up the remainder of the drive for storage, you can even make a swap file on it for lower memory systems if you want to.

That's what I have been doing for the last 6-9 months. Reason I set out to make this script was because I had to reformat the drive for another purpose and I had to read up on how to make it again, going through the same struggles I had the first time. My flash drive is 1 year old and I can't tell you how many times I have rebuilt it now, not because it failed, but because I have been trying to perfect this process over the last month. I have been using it in a business environment almost daily with no breakdowns or failures.

The most common form of breakdown I have experienced for flash drives is physical damage, like accidentally knocking them while plugged in and and breaking the thing in half.

By the way, you can get high speed flash drives for about double the cost of a standard unit. These high speed units make a huge difference in speed. You haven't experienced USB2.0 until you've used one of these high speed devices. They are normally branded"vista readyboost ready or capable", but why waste such a thing on such an over bloated useless lump of 0's and 1's. __{{emoticon}}__

Mike P
Posts: 316
DJiNN
Joined: 26 Oct 2007
#7
m_pav wrote:djinn, the resulting bootable thumb drive will be like a read-only CD, not a hard disk install, so writing will be minimal and reading will be the most common form of access.
Aha!! I see what you're getting at now. Very nice, and extremely portable too. I'm liking where this is going, and could really get into the whole"OS on a stick" thing! __{{emoticon}}__
After building your USB key, you can shrink the first partition to the smallest size it will go because it is read-only, and make a second partition to fill up the remainder of the drive for storage, you can even make a swap file on it for lower memory systems if you want to.
That sounds reasonable, although i'd probably want to leave at least a little space for a few"extras" should the need ever arise (Which it almost certainly will!).
That's what I have been doing for the last 6-9 months. Reason I set out to make this script was because I had to reformat the drive for another purpose and I had to read up on how to make it again, going through the same struggles I had the first time. My flash drive is 1 year old and I can't tell you how many times I have rebuilt it now, not because it failed, but because I have been trying to perfect this process over the last month. I have been using it in a business environment almost daily with no breakdowns or failures.
Hmmm, it's sounding more tempting by the second! Does it take up roughly the same amount of space as a regular CD iso would? (More ot less?) I like the idea of having the OS on there, but also having plenty of room on there for other things if needed, using the rest of the stick as a"Normal" USB flash drive. I take it that making partitions on the USB drive isn't a problem? Good to know that you've been using it on a daily basis for that period of time as well, without problems.
The most common form of breakdown I have experienced for flash drives is physical damage, like accidentally knocking them while plugged in and and breaking the thing in half.
I popped a 2GB Corsair stick just a few weeks ago, for no other reason than it just stopped working. I suspect that, for some reason, it got"Zapped" by one of the USB ports that i'd plugged it into at some point, because it did"Smell" a bit burned. __{{emoticon}}__
By the way, you can get high speed flash drives for about double the cost of a standard unit. These high speed units make a huge difference in speed. You haven't experienced USB2.0 until you've used one of these high speed devices. They are normally branded"vista readyboost ready or capable", but why waste such a thing on such an over bloated useless lump of 0's and 1's. __{{emoticon}}__
Heehee....... Now you've got me VERY interested indeed! I think USB2 is reasonably fast as it is, but having a faster USB connection would of course be even better. I shall look out for the"Ready Boost" sticks & see if i can get one. With the price of USB stick coming down all the time, i should be able to get a 2-4gb stick that's"Ready Boost" enabled. I'm off to check out eBay right now. __{{emoticon}}__ Thanks for the help. I'll let you know how it goes.

DJiNN
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#8
Tried the script and was successful on one usb stick.

Could you make it possible to install on a 512MB stick?
As antiX will never be more than 400MB and antiX-base is around 210MB, 512MB is ok.
Posts: 19
m_pav
Joined: 12 Sep 2007
#9
Sure Anti. (do you mind the shortening)

I had originally intended to make it 512Mb in the final stage.

I found one issues this morning - it boots fine on any notebook I try, but on the one desktop, it stops at grub.

Be interested in finding others reactions.

I may have to make a desktop version, or at least find out why grub doesn't configure when used from the desktop I tried with.

For the sake of interest, could all testers please indicate what machines they are testing it on?

I can verify it works on Acer, Asus, Compaq, HP & Toshiba notebooks

To bring up the boot device selection menu on notebooks
Acer - press F12
Asus - Press F12 or F8
Compaq - Press Esc or F10
HP - Press Esc or F10
Toshiba - Press F12

For owners of the Acer AspireOne, use the cheatcode vga=8 to get the correct video resolution.

Mike P
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#10
Thanks Mike.

Should users be doing this from hard drive or livecd?
Posts: 903
plvera
Joined: 11 Oct 2008
#11
I tried the script on my dell inspiron 1721 and it worked successfully, in fact, I'm running Antix from the stick now. I'll try on a couple of other 'puters too.

I had a small problem though. The instructions worked fine until step 5, from my harddisk install of antix 8, test1. However, after unplugging the drive, I could not see it again, nor mount it manually even though sfdisk said it was there.

Anti suggested rebooting and that did not work. He also suggested running the script from livecd. Livecd test 2, still did not pick up the drive, but I ran the script, and then it did, although there were 2 drives listed.

The first drive did change names as your post said it would, the second one was not accessible. I loaded antix8 test 2 into the drive, and rebooted and it worked great!

I'll test a couple of other laptops and post how that goes.

Great script! Thanks for the work that went into this.
Regards,
Pedro
Posts: 19
m_pav
Joined: 12 Sep 2007
#12
anticapitalista wrote:Thanks Mike.

Should users be doing this from hard drive or livecd?
I've always run it from hard disk install and from what I gather, any Linux will do it provided the necessary programs are installed.

I haven't tried it from a live CD, it may very well work, provided you have an iso image stored somewhere you can access it.

@plvera, not sure why you couldn't access the reformatted drive after unplugging it and re-plugging. If you ever get to do it over again, can you please post the output of dmesg |tail just after you unplug and another just after you replug? Thanks for the feedback.

One of the things I have noticed is an error trying to access a ntfs partition from the live-usb, but I think it was uncleanly shut down, so will try again and report back.

Thanks

Mike P
Posts: 903
plvera
Joined: 11 Oct 2008
#13
Mike:
I was unable to replicate the problem I had. I erase all the contents of the USB drive but it was still recognized as Antix by pcmanfm, from my HD install. I re-ran the script and it was fine. So, I still don't know what happened the first time.

In other news, the drive works fine for:

Dell Inspiron 5150
Acer Aspire 1 (mini laptop)

I have a question. Is is possible to save settings (like wireless) or anything, really, to the stick? Is that where creating a partition comes in like you mentioned in your post?
Regards,
Pedro
Posts: 19
m_pav
Joined: 12 Sep 2007
#14
It won't save settings as the Live USB is designed to operate as a live-cd type file system with the exception that it runs faster from a USB thumb drive. The extra partition is useful for saving stuff that you have created, or if you want to make the 2nd partition an ext3 file system, you can assign the permissions for it to yourself (which will end up being UID 1000, so it will work with any first user account in a Debian based system, even on a hard disk install using a different login name) and copy the entire contents of the demo users /home folder to the extra partition and mount-bind it to the /home/demo after booting a system with the thumb drive. Of course, it would be best to encrypt it if it were to be used for that purpose.

This may be getting a little complicated for the average user (and me!) but I could get my script mentor to look over the process and possibly assist me to make a thumb drive that could act as your very own portable antiX Live USB with your settings intact and loadable at login. Don't hold me to that, for the time being, it's just wishful thinking, but once again, I call on the masters of the Unixverse to step in and take this bull by the horns and make something really unique and useful out of it. I'm keeping this whole thing open source as much as is humanly possible.

Mike P
Posts: 903
plvera
Joined: 11 Oct 2008
#15
Thanks for the info, Mike. It does sound complicated, but it still is a great script and a great tool.

It should be possible to install Antix from the USB stick, correct? For example, in an Acer one aspire with no cd-rom attached.

Regards,
Pedro