Modify Linux commands to use Kingston Flash Media reader. - TechRepublic
Question
August 11, 2008 at 05:42 AM
charliespencer

Modify Linux commands to use Kingston Flash Media reader.

by charliespencer . Updated 17 years, 10 months ago

One of our locations performs the following process to program flash memory cards. They boot a laptop from a Knoppix CD and type the commands in one at at time. I’m trying to build a desktop to accomplish the same task, but I want to boot from the hard drive and put all the commands in one file. I’m using Debian 2.6.18-6-686 and a Kingston FRC-HS219 6-in-1 media reader.

The original procedure is below, as copied from a Word file. I’m not sure why they documented each command with ‘echo’ lines; maybe the contents of the Word file were copied from a now-lost command file. I’ve numbered each line here to make it easier to
reference them; the numbers are not part of the actual commands I’m entering.

echo ?Mount the Linux hard drive to the Knoppix?
1. mount /dev/hda3 /media/hda3
echo ?Move to the Linux Root folder containing the image file?
2. cd /media/hda3/root
echo ?Burn the image file to the Compact Flash Card?
3. dd if=nia-720.img of=/dev/hde
echo ?Move to the folder containing the installation file?
4. cd niafs720
echo ?Format the Compact Flash Card?
5. sfdisk -f /dev/hde /dev/null
6. sfdisk -f /dev/hde <128mb1.part> /dev/null
echo ?Make file system?
7. mkfs.ext3 /dev/hde1
echo ?Mount the device, IMPORTANT: must specify file system type be ext3?
8. mount ?t ext3 /dev/hde1 /mnt/hde1
echo ?Install NIA software?
9. tar ?zxf instimage.tgz ?C /mnt/hde1
10. rm ?rf /mnt/hde1/var
11. tar ?zxf uss.tgz ?C /mnt/hde1
echo ?Change the root folder to the Compact Flash Card and run the lilo configuration?
12. chroot /mnt/hde1
13. lilo ?v 3 ?C etc/lilo.config
echo ?Exit and umount the Compact Flash Card?
14. exit
15. umount /dev/hde1

Here’s what I’ve got so far. I’ve determined the appropriate slot in the media reader is /dev/sdb. I created a /mnt/sdb1 directory. I copied nia-720.imp and the niafs720 directory from the original machine into /home. I deleted the first line entirely since it shouldn’t be necessary to mount the HD when I’m booting from it.

2. cd /home
3. dd if=nia-720.img of=/dev/sdb
4. cd niafs720
5. sfdisk -f /dev/sdb /dev/null
6. sfdisk -f /dev/sdb <128mb1.part> /dev/null
7. mkfs.ext3 /dev/sdb1
8. mount -t ext3 /dev/sdb1 /mnt/sdb1
9. tar ?zxf instimage.tgz ?C /mnt/sdb1
10. rm ?rf /mnt/sdb1/var
11. tar ?zxf uss.tgz ?C /mnt/sdb1
12. chroot /mnt/sdb1
13. lilo ?v 3 ?C etc/lilo.config
14. exit
15. umount /dev/sdb1

Problem 2. I have been able to execute line 3 only one time. After testing the rest of the procedure, line 3 now returns:
dd: opening ‘/dev/sdb’: No medium found. How do I reset this card so I can refer to it as /dev/sdb again?

SOLVED BY SEANFERD: Problem 1. The system will not boot if the USB flash media reader is connected. Instead it gets so far (I don’t know how to tell; advice, please) and then does a hard reboot on it’s own. It boots okay if I disconnect the media reader before booting. What do I have to do to allow the system to boot with the media reader attached?

This discussion is locked

All Comments