Jump to: navigation, search

Sugar on a Stick/Linux

4,797 bytes added, 12:10, 26 February 2015
no edit summary
== Introduction ==
This page provides additional detail for installing '''[[Sugar on a Stick/Mirabelle|Mirabelle]]''', the most stable, released version of Sugar on a Stick (SoaS), available at [ this download site], onto a USB/SD flash storage device using GNU/Linux.
The page [[Sugar on a Stick/Linux/Installation]] provides up-to-date and concise instructions for loading the most recent released version of [[Sugar on a Stick]] (SoaS) onto a USB/SD flash storage device using GNU/Linux. ==livecd-iso-to-disk tool== Before experimenting beyond the instructions in the link above, please read [[fedora: To explore How to create and use Live USB]] for more background details. That page starts with Direct Write methods of creating a variety (non-persistent) Live USB system, and further down the page describes using the livecd-iso-to-disk tool which is the prefered method of making persistent Sugar on a Stick. The reader should be aware that Ubuntu/Debian use a method to create a live USB system which is fundamentally different to Fedora's method, used by Sugar. :''experimentalQuote from the above Fedora page'' : '''Issues using other Linux distributions''' : Ubuntu and derivative Linux distributions have a usb-creator program similar to Live USB Creator. This does not work with Fedora ISO images, it silently rejects them. usb-creator requires the ISO to have a Debian layout, with a /.disk/info file and a casper directory. Do not attempt to use this utility to write a Fedora ISO image. : The livecd-iso-to-disk script is not meant to be run from a non-Fedora system. Even if it happens to run and write a stick apparently successfully from some other distribution, the stick may well fail to boot. Use of livecd-iso-to-disk on any distribution other than Fedora is unsupported and not expected to work: please use an alternative method, such as the "direct write" methods described above. :''end Quote'' === Persistence ===Persistence in the context of a live USB system, is the ability to save both system changes, including Software updates, and the user' options s work between sessions, that is after shutdown and reboot. ==Linux users, suggested methods == Linux users might consider reading the following pages for putting a supported methods to install SoaS. '''Users of Fedora and Red Hat derivitives:''':[[What Sugar on a Stick/Linux/Installation]] '''Debian, Ubuntu, and derivitives, and other distros:''' :Make your SoaS from within a Sugar Live OS environment, which is itself a Fedora system. : '''Either''' Burn a Sugar?|.iso and follow the section of [[Sugaron a Stick/Installation]] entitled :: "1. Burn a CD-ROM disc, boot from it, then run the script, ''livecd-iso-to-disk''" : '''or''' create a Sugar image by dd or any of the methods on a USB or SD flash drive under GNU[[ Testing/Reports/LinuxSugar_on_a_Stick_Persistence|this page]]. Then boot into the Live OS, see to create SoaS from the following pages:running Live OS image.
: [[Sugar on a Stick/Beta|SoaS test builds]] | [[Sugar on a Stick/Installation/OLPC|OLPC XO-1]] | [[Sugar on a Stick/Linux/openSUSE|openSUSE]] | [[Trisquel On A Sugar Toast|Trisquel]] | [[VirtualBox]] | [[VMware]] | [[Sugar on a Stick/Linux/Non-compressed Fedora|non-compressed Fedora]] | [[:Category:Live USB|Live USB: (all known portable Sugar distributions)]]
If you have questions, trouble, or feedback, please let us know on the [[{{TALKPAGENAMEE}}|discussion]] page. If you can improve these instructions, please edit the page and do so!
* See this reference for more background details: [[fedora:How to create and use Live USB#Graphical Method - Windows or Fedora]]
== Put SoaS onto Experimental== To explore a variety of experimental options for putting a [[What is Sugar?|Sugar]] image on a stick using Fedora USB or Ubuntu ==SD flash drive under GNU/Linux, see the following pages:
This is [[Sugar on a Stick/Beta|SoaS test builds]] | [[Sugar on a Stick/Installation/OLPC|OLPC XO-1]] | [[Sugar on a Stick/Linux/openSUSE|openSUSE]] | [[Trisquel On A Sugar Toast|Trisquel]] | [[VirtualBox]] | [[VMware]] | [[Sugar on a Stick/Linux/Non-compressed Fedora|non-compressed Fedora]] | [[:Category:Live USB|Live USB: (all known to work in Fedora and Ubuntu.portable Sugar distributions)]]
First, download a === Load SoaS-Mirabelle {{Code|.iso}} image from, then return here.further insight ===
::<small>(A program called UNetBootin available at This is known to work in Fedora and has been reported to work in Ubuntu. First, download a SoaS {{Code|.iso}} image from http://unetbootinspins.sourceforgefedoraproject.netorg/ does all this magic for yousoas/#downloads, then return here... or you can do the magic yourself:)</small>
* Make sure you have the ''syslinux'' package installed on the operating system that you will use to prepare the Live USB image. It is recommended that you also have the ''isomd5sum'' package installed. The ''cryptsetup'' package is another option potentially used by the "livecd-iso-to-disk" installation script. (On Ubuntu, {{Code|sudo apt-get install syslinux isomd5sum cryptsetup}} will install the packages. They are also available through the Synaptic Package Manager.)
:*''[[wikipedia:md5sum|isomd5sum]]'' is needed for the recommended verification step, which checks that the .iso file is complete after its travels. If there is a problem with the .iso file, the script will exit and provide a failure message. The verification step can be bypassed by using the <code>--noverify</code> option.
:*''[[wikipedia:dm-crypt|cryptsetup]]'' is only needed for the option to provide password protection and encryption for the persistent /home/liveuser folder. It is not necessary if one applies the recommended {{Code|--unencrypted-home}} option. The {{Code|--unencrypted-home}} option is preferred because the reduced overhead improves robustness with the compressed ''[[wikipedia:SquashFS|SquashFS]]'' file system employed by the Live USB deployment.
* Plug in a 1-2 GB or larger USB stick into your computer.* Download the installation script:<br>(You will execute this script several steps below.)<br>See [[fedora:Livecd-iso-to-disk.pod]] for usage details.** Alternatively, loop mount Mount the 'SoaS.iso' image to reach the onboard livecd-iso-to-disk installation script:**: {{Code|losetup /dev/loop1 /path/to/Fedora-13-i686-Live-SoaS.iso}}**: {{Code|sudo mkdir /mntrun/soas/}}**: {{Code|sudo mount /devpath/loop1 to/mnt/soas/}}**: {{Code|losetup /dev/loop2 Fedora-Live-SoaS-x86_64-20-1 /mntrun/soas/LiveOS/squashfs.img}}**: {{Code|mkdir /mnt/squash/}}**: {{Code|(mount : /dev/loop2 /mnt/squash/}}loop0 is write-protected, mounting read-only)**: {{Code|losetup /dev/loop3 /mnt/squash/Change the working directory to the LiveOS/ext3fsfolder on the SoaS.img}}**iso mount: {{Code|mkdir /mnt/ext3fs/}}**: {{Code|mount cd /devrun/loop3 /mnt/ext3fssoas/LiveOS}}**:: Later below, substitute Execute {{Code|/mnt/ext3fs/LiveOS./livecd-iso-to-disk--help}} for the shell script name usage details. (the The file is already executable.).
* Check the USB device node name on your system. In the example below, the <abbr title="small computer system interface">'''s'''torage csi</abbr> '''d'''evice is /dev/sdb sdc and filesystem partition on that device is /dev/sdb1:sdc1: {{Code|df -Th}}
$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
rootfs rootfs 20G 12G 7.5G 61% /udev devtmpfs 1.6G 0 1.6G 0% /devtmpfs tmpfs 1.6G 904K 1.6G 1% /dev/shmtmpfs tmpfs 1.6G 788K 1.6G 1% /run/dev/sda1 sda2 ext4 18G 20G 12G 7.5G 61% /tmpfs tmpfs 1.6G 0 51.6G 12G 330% /sys/fs/cgrouptmpfs tmpfs 1.6G 536K 0 1.6G 10% /media/dev/sda2 ext4 20G 12G 7.5G 61% /tmp/dev/shmsda2 ext4 20G 12G 7.5G 61% /var/tmp/dev/sdb1 sda2 ext4 vfat 20G 12G 7.5G 61% /home/dev/loop0 iso9660 996M 668M 668M 0 100% /run/soas/dev/sdc1 vfat 3.8G 996M 4.0K 3.8G 01% /run/media/MyUSBdiscMountpointMyAccount/MyUSBdiscMountPoint
Another way to find out the USB device node name on your system is issuing the command
sudo fdisk -l
and looking in the output for the disk that corresponds to the USB device, e.g., a disk described with a stanza like
Disk /dev/sd'''?''': 1939 MB, 1939865600 bytes
150 heads, 42 sectors/track, 601 cylinders, total 3788800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e14bf
Device Boot Start End Blocks Id System
/dev/sd'''?'''1 * 2048 3784703 1891328 c W95 FAT32 (LBA)
where '''?''' in /dev/sd'''?''' is (usually) a letter of the alphabet.
If you have only '''one''' storage device with 2 GB of nominal capacity, it will be easy to recognize the USB device in the fdisk output by looking at which device has (about) 2 GB of capacity. In the example above, "Disk /dev/sd'''?'''" reports to be as large as ''1939 MB'', that is almost 2 GB.
If you have '''more than one''' disk with about 2 GB of capacity, consider moving to a situation where you'll have only '''one''' device with 2 GB of capacity, because this will help out a lot in recognizing the drive correctly.
* Unmount the drive,<br>
: {{Code|sudo umount /run/media/MyUSBdiscMountpointMyAccount/MyUSBdiscMountPoint}}:: <small>(The {{Code|/run/media/MyAccount/}} path is the new, standard Fedora mount point. Other operating systems may use {{Code|/media/MyMountPoint}}.)</small>{{:Sugar on a Stick/Linux/bootable device}} * Run {{Code|livecd-iso-to-disk}} as the root user, making sure to pass the correct USB device node name and to set overlay and home size appropriately, depending on the target USB device storage capacity.:<div style="padding: 1em; border: 1px dashed #2F6FAB; background-color: #FBFBFB; margin: 1em 0px 1em 0em; font-family: Courier;">./livecd-iso-to-disk --reset-mbr --overlay-size-mb '''500''' --home-size-mb '''800''' --unencrypted-home '''/path/to/downloaded'''.iso /dev/sd'''?'''1</div>: If the command fails telling you that /dev/sd'''?'''1 does not exist, try using the command for /dev/sd'''?''' (the name of the device) and not for /dev/sd'''?'''1 (the name of the partition), like this: :<div style="padding: 1em; border: 1px dashed #2F6FAB; background-color: #FBFBFB; margin: 1em 0px 1em 0em; font-family: Courier;">./livecd-iso-to-disk --reset-mbr --overlay-size-mb '''500''' --home-size-mb '''800''' --unencrypted-home '''/path/to/downloaded'''.iso /dev/sd'''?'''</div> : If the command fails returning a complaint about the filesystem not being mounted, '''and''' you can afford to '''loose all data on the USB device''', you can try reformatting the USB device filesystem:
:* Then check to see that mount the partition is marked as bootableUSB device (e.g., by unplugging and re-inserting it),<br>: * repeat the steps for learning its device name (there can be situations when the device name has changed!):* issue the command with the '''{{Code|sudo fdisk --format --msdos}}''' options, like this:{{Note/warning|Warning|The command described here will ask for a confirmation and will '''-ldestroy'''all pre-existing data on your USB device.<br>See also [[olpc:How_to_Damage_a_FLASH_Storage_Device|How to Damage a FLASH Storage Device]] for a discussion of why using the factory format is preferred.}} ::<div style="padding: 1em; border: 1px dashed #2F6FAB; background-color: #FBFBFB; margin: 1em 0px 1em 0em; font-family: Courier;">./livecd-iso-to-disk --reset-mbr '''<--format --thatmsdos's a lowercase letter 'L' for the --overlay-size-mb '''500''l'--home-size-mb ''ist option.'800'You should see output that looks like this: Disk /dev/sdb: 1047 MB, 1047265280 bytes 255 heads, 63 sectors/track, 127 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x0008325f . Device Boot Start End Blocks Id System /dev/sdb1 * 1 127 1020096 6 FAT16The '*' under the Boot column is what you want to see.: If not, then:* For Ubuntu 8.10, menu: System -> Administration -> Partition Editor (GParted).::# Select your USB device (unencrypted-home '''/path/devto/sddownloaded''b'' for the rest of these instructions),::# then your partition (.iso /dev/sd''b1'?'),::# then menu: Partition -''</div> Manage Flags,::# check the boot box,::# and Close to mark the partition as bootable.
:* For Fedora{{Highlight|In the above examples,::# the {{Code|parted '''/path/devto/sddownloaded''b''.iso}}::# may be substituted with {{Code|toggle 1 boot/dev/loop0}}::# {{Code|quit, as this is the loop device that the mount command chose.}}
* Change mode to make the script executable. : {{CodeNote/note|Note|chmod +x Additional USB or SD devices may be loaded from a running ''Sugar on a Stick'' image that was loaded with the livecd-iso-to-disk.shscript (but not those installed by other methods) by running this command in the Terminal Activity as a root user:}}* Run it as root, making sure to pass the correct USB device and to set overlay and home size appropriately, depending on the stick size.: {{Code|sudo .<div style="padding: 1em; border: 1px dashed #2F6FAB; background-color: #FBFBFB; margin: 1em 0px 1em 0em; font-family: Courier;">/run/initramfs/live/LiveOS/ --reset-mbr --overlay-size-mb 300 '''500''' --home-size-mb 200 --delete-home '''800''' --unencrypted-home /pathrun/toinitramfs/SoaS.iso livedev /dev/sd''b1'?'}}:: '''Note:''' With the soas-2-blueberry.iso, leave out the 3 options for a separate persistent home. The script will complete successfully, but the new installation startup process will have trouble finding the home folder and fail to complete.1</div>
:: Normally, the The ''livecd-iso-to-disk'' installation method has the advantage other advantages over the ''liveusb-creator'' installation method by allowing the creation of a separate, persistent /home/liveuser folder with the <tt>--home-size-mb ''NNN''</tt> option. This feature would allow you avoids consumption of the persistent overlay for Activity storage (see [[LiveOS image]]) and allows one to update the OS image while keeping the user files (by running the script against your existing installation but <u>leaving out</u> the --home-size-mb NNN option).::* The A {{Code|--delete-home}} option is used available to avoid an error message while requesting both a new home (with {{Code|--home-size-mb}}) and when there is already a persistent home (indirectly with {{Code|--unencrypted-home}}on the device). You wouldn't use the --delete-home option on an upgrade of the operation operating system only.:Depending on the size of your USB stick, you may have to decrease {{Code|--overlay-size-mb}} and {{Code|--home-size-mb}} values (for example, for a 1-2 GB stick, use 300 500 for the overlay and 200 800 for the home folder).:: If you have sufficient capacity on your target device, and format it with an ext[234] filesystem to overcome the 20484096-MB fat32 file size limit, you may avoid the SquashFS compression by including the {{Code|--skipcompress}} option in the script command line.<!--:* If you get an error about udevinfo, you have the new version of udev where "udevadm info" is the proper command.:*:Create an executable file called udevinfo somewhere in your path with the following contents::::{{Code|#!/bin/bash}}<br>:::<code>udevadm info $*</code> -->
:* Watch out for errors in the output of the script, the script seems to ignore them! (and say all is fine on the last line). transcript===
[LiveOS]$ sudo ./ --reset-mbr --overlay-size-mb 300 500 --home-size-mb 200 800 --deleteunencrypted-home --unencrypted-/home /mntMyAccount/VMsDownloads/Fedora-13Live-SoaS-x86_64-Live20-SoaS1.iso /dev/sdb1sdc1
Verifying image...
/mnthome/VMsMyAccount/Downloads/Fedora-13Live-SoaS-x86_64-Live20-SoaS1.iso: 7bb43cb6237802347e06d636b5974796 b0a9414ff7eb79b680d5c86440e19587Fragment sums: 5cb46db2dd7545c7154d99616eaa942ca515fb37188c34cf82564a498b689bfe23577651c88dcfb78c76ac3a28a5c53eead4561e3bdc5921b8b2e748
Fragment count: 20
Press [Esc] to abort check.
It is OK to use this media.
Copying live image to USB sticktarget device.squashfs.img 630,784,000 100% 1.96MB/s 0:05:06 (xfr#1, to-chk=0/1)osmin.img 8,192 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=0/1)
Updating boot config file
Initializing persistent overlay file
300500+0 records in300500+0 records out314572800 524288000 bytes (315 524 MB) copied, 35216.3334 717 s, 82.9 4 MB/s
Initializing persistent /home
200800+0 records in200800+0 records out209715200 838860800 bytes (210 839 MB) copied, 24344.2014 643 s, 82.7 4 MB/s
Formatting unencrypted /home
mke2fs 1.4142.12 8 (1720-MayJun-20102013)
Filesystem label=
OS type: Linux
Block size=1024 4096 (log=02)Fragment size=1024 4096 (log=02)
Stride=0 blocks, Stripe width=0 blocks
51200 51296 inodes, 204800 blocks
10240 blocks (5.00%) reserved for the super user
First data block=10Maximum filesystem blocks=6737100820971520025 7 block groups8192 32768 blocks per group, 8192 32768 fragments per group2048 7328 inodes per group
Superblock backups stored on blocks:
819332768, 2457798304, 40961, 57345, 73729163840
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 33 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.tune2fs 1.4142.12 8 (1720-MayJun-20102013)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Installing boot loader
USB stick Target device is now set up as live with a Live image!
== What's next? ==
After you've created your stick, it's time to [[Sugar_on_a_Stick#Sugar on a Stick/Boot|boot your stick]] and [[Sugar on a Stick/Getting Involved | test]] it out. Please also [[Sugar on a Stick/Getting Involved/Testing | report]] your observations.

Navigation menu