Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.

Welcome to Eric Hameleers (Alien BOB)'s Wiki pages.

If you want to support my work, please consider a small donation:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
slackware:usbboot [2006/10/02 20:55] – Some touch-ups to the text. alienslackware:usbboot [2009/11/27 13:20] (current) – Use haX instead of hda to prevent disaster when copying/pasting alien
Line 1: Line 1:
 ====== Install Slackware using a bootable USB stick  ====== ====== Install Slackware using a bootable USB stick  ======
 +
 +<note>Please note that starting with Slackware 12.0 installing from USB stick or from the network (PXE boot) is supported out of the box!\\ You can find the USB bootable image file called ''usbboot.img'' in the **/usb-and-pxe-installers** directory. Also, Slackware contains modified versions of my Wiki pages in that same directory. They are called **README_USB.TXT** and **README_PXE.TXT**.\\ 
 +The remainder of this Wiki article is basically preserved here as a technical reference, but you are no longer required to follow all the instructions below. Check out the Slackware //README//s instead.
 +</note>
  
 ===== Introduction ===== ===== Introduction =====
Line 50: Line 54:
  
   * Create a DOS formatted image file: <code>   * Create a DOS formatted image file: <code>
-mkfs.msdos -n USBSLACK -F 16 -C /tmp/slackboot/usbboot.img ${USBIMG)+mkfs.msdos -n USBSLACK -F 16 -C /tmp/slackboot/usbboot.img ${USBIMG}
 </code> You will notice that we use the switch "''-C''" and the variable ''${USBIMG}'' that we calculated in the previous step. With the ''mkfs.msdos'' commandline like that, we can omit the step where we would use the "''dd''" command to create the file prior to formatting it - ''mkfs.msdos'' will do that for us at no cost.\\ The command also labels the new FAT filesystem with the name //USBSLACK// (the "''-n USBSLACK''" option) but this is not required.\\ The important piece of information that is contained in the command is the fact that this FAT filesystem **must** be a FAT16 filesystem (''-F 16''). It is tempting to use FAT32 but the ''syslinux'' bootloader will fail to make the USB stick bootable if the filesystem is not FAT16.\\ \\ The file ''/tmp/slackboot/usbboot.img'' will eventually be the file to copy to the USB stick. </code> You will notice that we use the switch "''-C''" and the variable ''${USBIMG}'' that we calculated in the previous step. With the ''mkfs.msdos'' commandline like that, we can omit the step where we would use the "''dd''" command to create the file prior to formatting it - ''mkfs.msdos'' will do that for us at no cost.\\ The command also labels the new FAT filesystem with the name //USBSLACK// (the "''-n USBSLACK''" option) but this is not required.\\ The important piece of information that is contained in the command is the fact that this FAT filesystem **must** be a FAT16 filesystem (''-F 16''). It is tempting to use FAT32 but the ''syslinux'' bootloader will fail to make the USB stick bootable if the filesystem is not FAT16.\\ \\ The file ''/tmp/slackboot/usbboot.img'' will eventually be the file to copy to the USB stick.
  
Line 130: Line 134:
  
 FIXME __This part remains to be written__ FIXME FIXME __This part remains to be written__ FIXME
- 
- 
  
 ===== Restoring a USB stick to its original state ===== ===== Restoring a USB stick to its original state =====
Line 139: Line 141:
  
 <note warning> <note warning>
-Take care about which device actually is your USB stick !!! The next command will render all present data on ''/dev/sda'' inaccessible by deleting it's partition table!!!+Take care about which device actually is your USB stick !!! The next command will render all present data on ''/dev/sdX'' inaccessible by deleting it's partition table!!!
 </note> </note>
  
   * First, wipe the bootsector of the USB stick: <code>   * First, wipe the bootsector of the USB stick: <code>
-dd if=/dev/zero of=/dev/sda bs=512 count=1+dd if=/dev/zero of=/dev/sdX bs=512 count=1
 </code> </code>
  
-  * Then, create a new FAT32 partition on the stick and write a FAT32 filesystem on it (vfat or //type 'b'// in fdisk terminology): <code> +  * Then, create a new FAT16 partition (//type '6'// in fdisk terminology) on the stick and write a FAT32 (vfat) filesystem on it: <code> 
-fdisk /dev/sda <<EOF+fdisk /dev/sdX <<EOF
 n n
 p p
Line 154: Line 156:
  
 t t
-b+6
 w w
 EOF EOF
-mkdosfs -F32 /dev/sda1 +mkdosfs -F32 /dev/sdX1 
-</code> The 10 lines starting with "''fdisk /dev/sda <<EOF''" and ending with the single word "''EOF''" are actually one single command spread over ten lines, //including// the two empty lines. This format is called a [[wp>heredoc|here-document]]. It allows us to use a command which expects interactive input (fdisk) non-interactively, in a shell script for instance. If you're uncomfortable with it you can just run <code>fdisk /dev/sda</code> and create a partition interactively :-)+</code> The 10 lines starting with "''fdisk /dev/sdX <<EOF''" and ending with the single word "''EOF''" are actually one single command spread over ten lines, //including// the two empty lines. This format is called a [[wp>heredoc|here-document]]. It allows us to use a command which expects interactive input (fdisk) non-interactively, in a shell script for instance. If you're uncomfortable with it you can just run <code>fdisk /dev/sdX</code> and create a partition interactively :-)
  
 Install Slackware using a bootable USB stick ()
SlackDocs