Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Latest commit

 

History

History
63 lines (54 loc) · 1.69 KB

make-an-usb-image.rdoc

File metadata and controls

63 lines (54 loc) · 1.69 KB

Create a bootable USB key with the pigebox distro

let's asume the USB key is mapped on /dev/sdc. Adapt with your own setup by looking
at dmesg right after plugging the key in the USB receptacle. You may need a 2GB key
for the standard setup, but a 512MB key may be enough for basic setup.
#create partitions on the key
sudo fdisk /dev/sdc
#delete every defined partition with 'd'
#Create the base partition
n
p
1
1
+500M
#Create the parameters partition
n
p
2
<enter> #this chooses the first cylinder after the last one allocated to the first partition
+100M
#The create 2 other partitions to handle distro updates (erf, sometime it will become a real product...)
n
p
3
<enter>
+500M
n
p
4
<enter>
<enter> #the last partition will use all the remaining space on the key
# make the base partition bootable
a
1
w #this writes the partition table on the USB key

Now remove and replug the USB key so that the new partition table is used

#let's format the different partitions
sudo mkfs.ext3 -L base -m 0 /dev/sdc1
sudo mkfs.ext3 -L params -m 0 /dev/sdc2
sudo mkfs.ext3 -L update1 -m 0 /dev/sdc3
sudo mkfs.ext3 -L update2 -m 0 /dev/sdc4

Once again, if partitions has not been auto-mounted, remove and replug the USB key
Now we copy the content of the pigebox image into the base partition

sudo cp -a /var/tmp/pigebox/image/* /media/base/

Then we must install grub on the USB key MBR

#first let's make a mark on the USB key
sudo touch /media/base/boot/usbkey

#The grub stuff
sudo grub
grub> find /boot/usbkey
  (hd2,0)
grub> root (hd2,0)
grub> setup (hd2)
grub> quit

There you are, your USB should be bootable now !