Find the answer to your Linux question:
Results 1 to 5 of 5
the USB disk: Code: [root@localhost m]# dmesg |tail sdb: assuming drive cache: write through SCSI device sdb: 7843840 512-byte hdwr sectors (4016 MB) sdb: Write Protect is off sdb: Mode ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Location
    China
    Posts
    26

    failed to make usb bootable disk(in detail)

    the USB disk:
    Code:
    [root@localhost m]# dmesg |tail
    sdb: assuming drive cache: write through
    SCSI device sdb: 7843840 512-byte hdwr sectors (4016 MB)
    sdb: Write Protect is off
    sdb: Mode Sense: 23 00 00 00
    sdb: assuming drive cache: write through
     sdb: sdb1 sdb2 < sdb5 >
    sd 3:0:0:0: Attached scsi removable disk sdb
    sd 3:0:0:0: Attached scsi generic sg1 type 0
    usb-storage: device scan complete
    SELinux: initialized (dev sdb1, type vfat), uses genfs_contexts
    [root@localhost m]#

    /dev/sdb is the USB disk:
    Code:
    [root@localhost m]# parted /dev/sdb
    GNU Parted 1.8.1
    Using /dev/sdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted)
    the old disk-partion:
    Code:
    (parted) print                                                           
    Model: Kingston DataTravler 2.0 (scsi)
    Disk /dev/sdb: 4016MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start   End     Size    Type      File system  Flags
     1      0.51kB  100MB   100MB   primary   fat16        lba 
     2      100MB   4016MB  3916MB  extended               lba 
     5      100MB   4016MB  3916MB  logical                lba
    delete the old disk-partion:
    Code:
    (parted) rm 5
    (parted) rm 2
    (parted) rm 1
    create new disk-partion:
    Code:
    (parted) mkpart                                                          
    Partition type?  primary/extended? primary                               
    File system type?  [ext2]? fat32
    Start? 0                                                                 
    End? 50M                                                                 
    (parted)
    (parted) mkpart                                                     
    Partition type?  primary/extended? extended                              
    Start? 49.4M                                                             
    End? 4016M                                                               
    (parted) mkpart
    Partition type?  primary/logical? logical                                
    File system type?  [ext2]? fat32
    Start? 49.5M                                                             
    End? 4016M 
    
    (parted) print                                                           
    Model: Kingston DataTravler 2.0 (scsi)
    Disk /dev/sdb: 4016MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Number  Start   End     Size    Type      File system  Flags
     1      32.3kB  49.4MB  49.3MB  primary                lba 
     2      49.4MB  4016MB  3967MB  extended               lba 
     5      49.4MB  4016MB  3967MB  logical                lba 
    
    (parted) quit
    format /dev/sdb1:
    Code:
    [root@localhost m]# mkfs.vfat /dev/sdb1
    mkfs.vfat 2.11 (12 Mar 2005)
    mount usb-disk:
    Code:
    [root@localhost m]# mount  /dev/sdb1 /mnt/tmp
    use grub-install script:
    Code:
    [root@localhost m]# grub-install --root-directory=/mnt/tmp '/dev/sdb'
    Probing devices to guess BIOS drives. This may take a long time.
    Installation finished. No error reported.
    This is the contents of the device map /mnt/tmp/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'.
    
    (fd0)   /dev/fd0
    (hd0)   /dev/sda
    (hd1)   /dev/sdb
    [root@localhost m]#
    edit /mnt/tmp/boot/grub/grub.confit's not ok under /mnt/tmp/boot yet)
    Code:
    [root@localhost grub]# cat grub.conf
    default=1
    timeout=5
    
    title Boot Linux
    root (hd1,0)
    kernel /vmlinuz
    initrd /initrd.img
    [root@localhost grub]#
    copy vmlinuz,initrd to /mnt/tmp/boot or /mnt/tmp is not ok...

    while I reboot my os ,it boot from the hard-disk not from usb-disk....

    I have set BIOS boot from usb-hdd first....

    what's wrong?????


    help me,please!!!!!

  2. #2
    Linux Guru waterhead's Avatar
    Join Date
    Jul 2004
    Location
    Franklin, Wisconsin
    Posts
    4,577
    I'm not sure exactly what it is you want to accomplish. If you just want to have Fedora boot from a USB (pen) drive, there is an easier way to do it.

    First, you want the Fedora LiveCD iso file. You don't need to burn it to a disk, you can just mount the image. First you need to create a folder to mount it in. Do these commands as root.
    Code:
    su
    Password: <enter root password>
    Code:
    mkdir /fedora
    You then need to mount the .iso file. As of this writing, the latest is F10-i686-Live.iso, so that is what I will use. I will also assume that it is in your home folder.
    Code:
    mount -o loop /home/<username>/F10-i686-Live.iso /fedora
    The following are my personal notes on doing the rest:

    Run commands as root

    Find the disk:
    # fdisk -l

    Format the disk (sdb1):
    # fdisk /dev/sdb1

    Command (m for help):d (delete any existing partitions)

    Command (m for help):n (create a new partition)
    Command action
    e extended
    p primary partition (1-4)
    p

    Partition number (1-4):1

    Command (m for help):t
    Partition number (1-4):1
    Hex code (type L to list codes):6 (for fat16)

    Command (m for help):w (to write the changes to the disk)

    Format the card. You may need to unmount it first:
    # umount /dev/sdb1
    # mkfs.vfat -F 16 /dev/sdb1

    Mount it again. You need syslinux and Mtools installed, Then run syslinux on the card:
    # syslinux /dev/sdb1

    Copy the CD files to it. Then rename the folder isolinux to syslinux. Then rename isolinux.cfg to syslinux.cfg

    Using syslinux is the key to booting from a USB pen drive. To copy the files, use the cp command.
    Code:
    cp /fedora /dev/sdb1
    Last edited by waterhead; 03-29-2009 at 07:28 PM.
    Paul

    Please do not send Private Messages to me with requests for help. I will not reply.

  3. #3
    Just Joined!
    Join Date
    Mar 2009
    Location
    China
    Posts
    26
    I only want to boot the existed system redhat..

    but not to boot by usb(pen) driver and install fedora from harddisk

  4. #4
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    Quote Originally Posted by zengmao View Post
    I only want to boot the existed system redhat..

    but not to boot by usb(pen) driver and install fedora from harddisk
    Its bit confusing...

    I guess you want to create a bootable usb drive or no?
    have you tried Unetbootin
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

  5. #5
    Linux Guru waterhead's Avatar
    Join Date
    Jul 2004
    Location
    Franklin, Wisconsin
    Posts
    4,577
    I guess that the OP must have an external hard drive, that has a USB connection.

    The computer must be able to boot from an external USB drive. Not all computers can do this, and most older computers cannot. You would have to go into the computer's BIOS, and change the settings to boot from a USB drive.
    Paul

    Please do not send Private Messages to me with requests for help. I will not reply.

Posting Permissions

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