Difference between revisions of "Template:Copying Alpine to Flash"

From Alpine Linux
Jump to: navigation, search
m (Format {{{1|Flash Medium}}})
(Copy Alpine to a {{{1|Flash Medium}}})
Line 1: Line 1:
 
== Copy Alpine to a {{{1|Flash Medium}}} ==
 
== Copy Alpine to a {{{1|Flash Medium}}} ==
 
+
# Boot the computer from the Alpine Linux CD-ROM
 
# Insert the removable {{{1|flash medium (CF or USB stick)}}} into the computer.
 
# Insert the removable {{{1|flash medium (CF or USB stick)}}} into the computer.
 
# Determine the name your computer uses for your {{{1|flash medium}}}. The following step is one way to do this.
 
# Determine the name your computer uses for your {{{1|flash medium}}}. The following step is one way to do this.
Line 34: Line 34:
 
#* {{Cmd|mkdir -p /media/sda1}}
 
#* {{Cmd|mkdir -p /media/sda1}}
 
#* {{Cmd|mount -t vfat /dev/sda1 /media/sda1}}
 
#* {{Cmd|mount -t vfat /dev/sda1 /media/sda1}}
# Mount the Alpine Linux CD-ROM, and copy the files to the {{{1|flash medium}}}
+
#Copy the files to the {{{1|flash medium}}}
#* {{Cmd|mount /media/cdrom}}
 
 
#* {{Cmd|cd /media/cdrom}}
 
#* {{Cmd|cd /media/cdrom}}
 
#* {{Cmd|cp -a .alpine-release * /media/sda1/ }}
 
#* {{Cmd|cp -a .alpine-release * /media/sda1/ }}

Revision as of 15:33, 10 October 2011

Copy Alpine to a Flash Medium

  1. Boot the computer from the Alpine Linux CD-ROM
  2. Insert the removable flash medium (CF or USB stick) into the computer.
  3. Determine the name your computer uses for your flash medium. The following step is one way to do this.
    • After inserting the flash medium, run the command:
    • dmesg

    • At the end of this command you should see the name of your flash medium, likely starting with "sd". (For example: "sda").
    • The remainder of this document will assume that your flash medium is called /dev/sda
Tango-dialog-warning.png
Warning: Be very careful about this. You do not want to mistakenly wipe your hard drive if it's on /dev/sda


Format Flash Medium

fdisk /dev/sda

  • p Print list of partitions
  • d Delete all partitions (this may take a few steps)
  • n Create a new partition
  • p A primary partition
  • 1 Partition number 1
    • Use defaults for first and last cylinder (just press [Enter] twice).
  • t Change partition type
  • c Type: Win95 FAT32 (LBA)
  • a Make the partition bootable (set boot flag)
  • 1 Partition number 1
  • w Write your changes to the device

Install Syslinux

Note: If the following commands fail due to 'No such file or directory', you may have to remove and reinsert the CF card, or even reboot, to get /dev/sda1 to appear
  1. Install syslinux and dosfstools. If you have booted from an Alpine CD-ROM, use these commands:
    • apk add syslinux dosfstools

    • dd if=/usr/share/syslinux/mbr.bin of=/dev/sda

  2. Format the flash medium with a VFAT filesystem:
    • mkdosfs -F32 /dev/sda1

    • syslinux /dev/sda1

    • mkdir -p /media/sda1

    • mount -t vfat /dev/sda1 /media/sda1

  3. Copy the files to the flash medium
    • cd /media/cdrom

    • cp -a .alpine-release * /media/sda1/

Troubleshooting

When your USB device is formatted to other filesystem than fat32, you might have to specify the necessary filesystem modules in boot parameters.

To do so, mount the device, and alter the syslinux.cfg file line from

append initrd=/boot/grsec.gz alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage quiet

to

append initrd=/boot/grsec.gz alpine_dev=usbdisk:vfat modules=loop,cramfs,sd-mod,usb-storage,ext3 quiet

in case of using ext3 formatted partition. Similar procedure might apply to other filesystems (if they are supported by syslinux or other bootloader of your choice and alpine kernel).

Also, specifying waitusb=X option might help with certain usb devices that take a bit longer to register. X stands for the amount of seconds kernel will wait before looking for the installation media.