acloudtree

(Nerd) How to: Create a DSL (damn small linux) bootable usb thumb drive using Ubuntu 9.10

You will need to download the latest .iso from the Damn Small Linux site.

Also, I am running ubuntu 9.10 as my host OS but you should be able to run any linux/unix operating system and the commands should work.

1) Plug in your usb device.

2) Next, open up the terminal application and enter the following command. By issuing sudo -i command, you are assuming the identity of root for the rest of the session.

sudo -i

3) Run the fdisk -l command to look at the devices installed on your system.

root@jetBook:~# fdisk -l

4) My output is posted below.

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x355aa9d3
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        9407    75561696    7  HPFS/NTFS
/dev/sda2            9408       18813    75553695    5  Extended
/dev/sda3           18814       19451     5124735   1c  Hidden W95 FAT32 (LBA)
/dev/sda4           19452       19457       48195   ef  EFI (FAT-12/16/32)
/dev/sda5            9408       18039    69336508+  83  Linux
/dev/sda6           18040       18813     6217123+  82  Linux swap / Solaris
 
Disk /dev/sdb: 4047 MB, 4047502848 bytes
4 heads, 32 sectors/track, 61759 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Disk identifier: 0x00000000
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       61759     3952560    b  W95 FAT32

First you will notice my internal hard drive and the several partitions that are written on it.

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x355aa9d3
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        9407    75561696    7  HPFS/NTFS
/dev/sda2            9408       18813    75553695    5  Extended
/dev/sda3           18814       19451     5124735   1c  Hidden W95 FAT32 (LBA)
/dev/sda4           19452       19457       48195   ef  EFI (FAT-12/16/32)
/dev/sda5            9408       18039    69336508+  83  Linux
/dev/sda6           18040       18813     6217123+  82  Linux swap / Solaris

5) We are primarily concerned about the following segment.

Disk /dev/sdb: 4047 MB, 4047502848 bytes
4 heads, 32 sectors/track, 61759 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Disk identifier: 0x00000000
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       61759     3952560    b  W95 FAT32

6) Since I only have two drives installed on my system (Internal HD, and USB thumb drive) we can logically deduce that /dev/sdb is the thumb drive, and for several reasons. The primary one being that I am using a 4GB drive, and the output next to /dev/sdb shows the total amount of memory.

Disk /dev/sdb: 4047 MB

7) Unmount the /dev/sdb1 partition

root@jetBook:~# umount /dev/sdb1

8 ) Run the following command

root@jetBook:~# fdisk /dev/sdb

Which will produce this prompt.

Command (m for help):

9) Delete any existing partitions.

Command (m for help): d
Selected partition 1

9a) Please note, you may get a prompt asking you for a number selection (1-4). You will need to keep going through this step in order to delete ALL of the existing partitions on the usb device. Example below assumes there are two partitions on the usb device.

Command (m for help): d
Partition number (1-4): 1
 
Command (m for help): d
Selected partition 2

10) Once the partition(s) are deleted, create a new one. Type the letter ‘n’ and press return. ‘n’ is for “New” partition.

Command (m for help): n

***) Enter the letter ‘p’ for primary and press return.

Command action
   e   extended
   p   primary partition (1-4)
p

11) Select number ’1′ for the partition number definition.

Partition number (1-4): 1

12) Enter ’1′ to designate the first cylinder.

First cylinder (1-61759, default 1): 1

13) Enter the large default number so that we can use the entire disk. In my case, the ending cylinder number is 61759.

Last cylinder, +cylinders or +size{K,M,G} (1-61759, default 61759): 61759

14) Make the drive bootable

Command (m for help): a
Partition number (1-4): 1

15) Show the definition table by entering the letter ‘p’ from the prompt. This is to make sure there is an asterisk under the ‘boot’ column.

Command (m for help): p
 
Disk /dev/sdb: 4047 MB, 4047502848 bytes
4 heads, 32 sectors/track, 61759 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Disk identifier: 0x00000000
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       61759     3952560   83  Linux

16) Write the changes to the disk by entering the letter ‘w’

Command (m for help): w
The partition table has been altered!

16a) Note: you may get the following error. Don’t worry, it is not a big deal but it does mean you probably didn’t correctly unmount the device in step (STEP #7).

Calling ioctl() to re-read partition table.
 
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

If this happens, it is now like a choose your own adventure book. You can…

  • Start over
  • Go back to step #7
  • Or remember that things may be screwed up, and proceed just to see if you can

Choose wisely…

17) Format the disk using ext2. !!!WARNING!!! if you mess this up, you can easily format the root partition of YOUR internal hard drive.

root@jetBook:~# mke2fs /dev/sdb1

Which will produce the following output.

mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
247008 inodes, 987989 blocks
49399 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1015021568
31 block groups
32768 blocks per group, 32768 fragments per group
7968 inodes per group
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736
 
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
 
This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

18) Make a usb directory inside /mnt

NOTE: if you are using a different flavor of linux/unix you will have to adjust the tutorial accordingly.

root@jetBook:~# mkdir /mnt/usb

19) mount the usb thumb drive partition to the newly created directory. In my case it is the 1st partition, sdb1.

root@jetBook:~# mount /dev/sdb1 /mnt/usb

20) Create an iso directory to eventually mount the dsl-4.4.10.iso

root@jetBook:/# mkdir /mnt/iso

21) Find the directory where your damn small linux .iso file exists. Since I used firefox3.5 to download the .iso, my file is in the ‘Downloads’ directory.

/home/YOUR_USERNAME/Downloads

22) Mount the .iso to the directory. Conceptually, this allows you access to the files stored in the .iso as if it were a common directory on your file system.

root@jetBook:# mount -o loop /home/YOUR_USERNAME/Downloads/dsl-4.4.10.iso /mnt/iso

23) Copy all the files from /mnt/iso into /mnt/usb. We issue the ‘-p’ flag so that we keep the existing permissions. We issue the ‘-R’ flag so the the copy is recursive.

root@jetBook:# cp -pR /mnt/iso/* /mnt/usb

24) Install grub into the boot block of /dev/sdb.

root@jetBook:# grub-install --no-floppy --root-directory=/mnt/usb /dev/sdb

25) You should get the following output.

Probing devices to guess BIOS drives. This may take a long time.
Installing GRUB to /dev/sdb as (hd1)...
Installation finished. No error reported.
This is the contents of the device map /mnt/usb/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
 
(hd0)	/dev/sda
(hd1)	/dev/sdb

26) Create the file menu.lst in the /mtn/usb/boot/grub/ folder.

root@jetBook:/# vi /mnt/usb/boot/grub/menu.lst

28) Here is the contents of my menu.lst file and you are more than welcome to copy/paste the contents. There is one issue though, your hardware may not lay itself out like mine, so some further troubleshooting may be involved.

title Damn Small Linux
root (hd0,0)
kernel /boot/isolinux/linux24 root=/dev/sda1 ro lang=us toram noeject frugal
initrd /boot/isolinux/minirt24.gz
boot
EOF

29) At this point, you should be able to issue the following four commands in order to cleanup your file system

root@jetBook:# umount /mnt/iso
root@jetBook:# umount /mnt/usb
root@jetBook:# rm -R /mnt/usb
root@jetBook:# rm -R /mnt/iso

And from here on, it is all you. Just reboot your machine, and go into your BIOS in order to make sure you are booting from the usb device.

Please understand, in step #28 where you potentially copy/paste my ‘menu.lst’ settings, it is an area where you could run into problems. I will try and cover some information on the GRUB boot loader eventually. Because GRUB seems to mistify so many people, yet it is incredibly powerful.

60 minutes, Epilepsy, and Jaye Allen Folkins

Recently, my wife and I caught a 60 Minutes Program on the Axelrod family. Katie Couric interviewed David and his family about their daughter Lauren, who struggles with epilepsy. Her struggle is so severe, that is has caused her permanent brain damage.

There are a lot of things in the interview that brought out an emotional response from me. But one of the main quotes is the following.

“It’s been hard to explain to her,” David Axelrod replied. “She doesn’t understand why. She asks all the time, ‘Why does Barak Obama need so much help.’”

He recently surprised her with an unplanned visit. While the Axelrods are grateful for how far their daughter has come, they are committed to helping other families intervene sooner than they could for Lauren.

“Do you ever look at her and kind of think, ‘Gee, what if? What would she be doing now?‘” Couric asked.

“Too often,” Susan Axelrod said. “And this is what happens. It’s painful.”

God knows what she could’ve been. But that’s a treacherous place to go. You know, there was a time when we have given our right arm for just a week of good days. And now, she has them consistently. So, you know, that’s a big victory,” David Axelrod added

This made me think of a thought I have had almost every day of my life since my brother died because of his epilepsy.

What could have been?
What would Jaye look like now?
What songs would he have written or what Girl would he love?

And David Axelrod is right, that is a dangerous place to dwell.

Then the other night, my seven week old daughter was quite fussy. So I started singing to her. I then ran out of songs, and for some reason I began telling her stories about her uncle Jaye. Who is her name sake (Gracie Jaye Folkins). Now I know she won’t remember the stories right now, but just talking to her about her uncle was nice.

That conversation (though one sided unless you count coo-ing) along with the 60 minutes segment, inspired me to put up my brother’s memorial video online. It is pretty long (1:15:00 minutes), and you will cry if you make it to the end, but it allows me a way to keep on remembering him. And hopefully it will remind others of how dear their loved ones are.

Don’t waste a moment.

UPDATE: I have moved Jaye’s video to his page. Here is the link.

The fallout from “Cash for Clunkers”

Cash for clunkers has been over for a while now, and the MSM (main stream media) probably thinks the story is over. But I went out to dinner with some friends last night. One of the gentlemen is in the car sales industry and the impact from the program is still carving a giant ditch through his life.

“Tony, if I wanted to purchase a car, how much buying power would I have right now?” I asked

“Dude, it is dead Jared. For a while there, it was amazing, but now, there are no f*cking sales what-so-ever.” hands waving, pointing to me with his thumb while he spoke.

Now, it is already my opinion that Cash for Clunkers is a Titanic of a failure. That it will eventually to be seen for doing more bad than good. But I wanted to see what Tony’s opinion is so I asked. ”The government has been touting the Cash for Clunkers program as a massive success.”

“Maybe for a month or two” he reasoned. “But now, it is even worse than before” stated with a matter-o-fact sincerity. “Despite the mess, I would have to say that I am the lucky one.”

Curious to see how he could possibly consider himself lucky, I asked “How do you figure that?”

“Well, at least I have the opportunity to sell new cars. Its worse for these mom and pop used car places, they have been going under like crazy.” He could tell by my face that I was still not following his logic.

“Jared, we scrapped all their potential inventory with Cash for Clunkers” he reached for his beer, pulled it to his mouth and swallowed the last of the liquid that the glass contained. Then looking at me, he continued. “I have a buddy who is telling me they can’t find any used cars in their price range that have even the smallest margin to make a profit. The only ones they can find are pieces of garbage. And without inventory, they are folding.” slamming his empty pint glass on the table.

Finally connecting the dots and letting his point sink in for a moment, I revealed my beliefs.

“Well Tony, I can honestly say I am not surprised.”

It was his turn to be curious. “And why is that?”

“Lets use an example.” I begin. “Say you take five months, August, September, October, November, December, and January” Interested, Tony leaned forward and so I continued “And say that every month, on average, you sell 10,000 vehicles. How many vehicles total are we talking about?”

“Ok” he said thinking. “Well 5 months x 10,000 vehicles a month is 50,000 vehicles”

“Right!” I say in a congratulatory inflection. “The market is dictating the need for new vehicles, and it is saying that in those 5 months, it only needs 50,000 vehicles sold”

“Now, lets pretend that all of the sudden, cars for the months of August and September are HALF OFF! The market still only needs to sell 50,000 vehicles, so how many cars do you think would sell in those two months?” I questioned.

“Well, I wouldn’t be surprised if you sold all 50,000 in those two months alone” he surmised.

“Then how many would you sell for the months of October, November, December, and January?”

Raising his eyebrow, he spoke with some disdain “Not that many”

“Yeah” I said with a sour face and staunch agreement. “Not that many. And the danger is that we don’t know how many cars the Government pulled from future sales to sell during the Cash for Clunkers program. Was it 5 months? Was it 10 months? We just don’t know.”

“Then it makes sense why all these car places are going under” Tony’s voice was growing pretty hollow at this point. He looked down into his empty glass for what seemed like a long while. Then, Tony turned to look up at me and said

“I just am trying to make it through winter”

And I could see that underneath the warmth of the intoxicating Stout he had just drank, there was real fear. Real pressure. So looking him directly in the eyes, I smiled encouragingly and said

“Aren’t we all man, aren’t we all” and ordered another round.

We shit on the ones we love

Three years ago, I went out to a farm. Pulling up to the double wide, I parked the 4runner, and stepped out.

“Howdy!” a gal said as I approached.

“Hi” came my response. “I’m here about the German Shepherd puppies.”

“Well, they are right over here” she said pointing, then lead me to a gated area where six adorable puppies played. All of them were jumping, biting, and climbing over each other.

I knelt down and started the process. Reaching out a hand, stroking and touching all of them. The pack never seemed afraid or concerned, they seemed to feel that I was just another litter-mate. One of the males caught my eye and so I picked him up. And as I stared at him, I wondered;

Is this the one?

It was about this time that I felt something rather warm spread across the crook of my arm. Right where the pup’s hind quarters were. And looking down I saw and smelled the streak of crap, as it trailed itself down my shirt. It was accompanied by the newly began thumping of the puppy’s tail against my skin.

The woman’s eyes went wide. “Here-” she said “-give him to me” obviously disturbed.

Laughing to myself, I said “No he is fine.” then turning to face her, out came the words “I’ll take him.”

Her eyes grew even wider. “Really?” Shock now out-sourcing the statement to extreme disbelief.

“Yeah, I have to now-” the laughter still bubbling. “-he would be misunderstood with anyone else.” And that is how Stoic the dog came to be a part of our family.

Now three years later, I sit next to a tub and bathe my seven week old daughter. Stoic the dog protectively watches his newly acquired charge as I gently soap her body. Washing the creases and the folds, the ears and the toes. I turn on the faucet and start to rinse the suds from her skin when suddenly she begins to slip from my grasp. Without hesitation, I grab a quick hold, and scoop her and an arm full of water towards me. Her little body bounces against my chest, along with the wet as it drenches my shirt.

I can see Stoic the dog watching me out of the corner of my eye, catching me in my mistake. And the anger at myself over almost dropping my daughter makes me mutter a frustrated “Well shit!”

Not realising the prophetic nature of my words, and still clutching Gracie to my chest, I hear an outburst from below. A sound, that if my grandfather were to hear, he would make sure to retort “Report from Berlin!”

Looking down, I see Christmas green combined with the texture of oatmeal, exploding like a bug on a windshield across my soaked shirt. And with the sounds of artillery still firing out the behind of my baby girl, I turn and come face to face with Stoic the dog. Whom, I kid you not, tilts his head, perks his ears, and smiles at me.

Frustration melts away, replaced with deja vu glazed laughter. I smile, reach out my free hand, and give my puppy a pat on the head. “Yeah boy, we can keep her” I begin sheepishly. The thump and beat of a large doggy tail against the bathroom door starts to sound his consent. Then pulling my eyes back to my daughter, I lovingly say “She would be misunderstood with anyone else”

Copyright © Jared Folkins
Programming, Computers, Writing, Economics, and Life

Powered by WordPress