Find the answer to your Linux question:
Results 1 to 2 of 2
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. ...
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Location
    Batesburg, SC
    Posts
    2

    Copy files to USB media reader.

    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. This is my first attempt to build a production Linux system; my only previous experience is installing Fedora a couple of times for a few weeks. While I've looked at the man pages, I only about half understand what this does.

    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 <blank.part> /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 <blank.part> /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

    Here's problem 1. The system will not boot if the USB flash media reader is connected. Instead it gets so far (don't ask me; I don't know how to tell) 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?

    Here's 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?

    There's more to come if I can get past these issues!

  2. #2
    Linux User
    Join Date
    Feb 2006
    Posts
    484
    you need to edit the script and to form it to your system.
    find out what nem your system use each devices and than change it in the file

    ls /dev/sd*
    ls /dev/hd*
    dmesg #may you can read from the output the devicename for each drive

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •