Sugar on a Stick/Linux: Difference between revisions

livecd-iso-to-disk.sh transcript: updated transcript for Pineapple
update for Pineapple
Line 3: Line 3:
</noinclude>
</noinclude>
== Introduction ==
== Introduction ==
This page provides additional detail for installing '''[[Sugar on a Stick/Mango Lassi|Mango Lassi]]''', the most stable, released version of Sugar on a Stick (SoaS), available at [http://spins.fedoraproject.org/soas/#downloads this download site], onto a USB/SD flash storage device using GNU/Linux.
This page provides additional detail for loading '''[[Sugar on a Stick/Pineapple|Pineapple]]''', the most stable, released version of Sugar on a Stick (SoaS), available at [http://spins.fedoraproject.org/soas/#downloads this download site], onto a USB/SD flash storage device using GNU/Linux.


: To explore a variety of '''experimental''' options for putting a [[What is Sugar?|Sugar]] image on a USB or SD flash drive under GNU/Linux, see the following pages:
: To explore a variety of '''experimental''' options for putting a [[What is Sugar?|Sugar]] image on a USB or SD flash drive under GNU/Linux, see the following pages:
Line 12: Line 12:
* See this reference for more background details: [[fedora:How to create and use Live USB#Graphical Method - Windows or Fedora]]
* See this reference for more background details: [[fedora:How to create and use Live USB#Graphical Method - Windows or Fedora]]


== Put SoaS onto a stick using Fedora or Ubuntu ==
== Load SoaS onto a stick using Fedora or Ubuntu ==


This is known to work in Fedora and Ubuntu.
This is known to work in Fedora and Ubuntu.
Line 24: Line 24:
:*''[[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.
:*''[[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 2 GB or larger USB stick into your computer.
* Plug in a 2 GB or larger USB stick into your computer.
* Download the installation script: http://bit.ly/livecd-iso-to-disk.<br>(You will execute this script several steps below.)<br>Execute {{Code|tools_livecd-iso-to-disk --help}} for usage details.
* Mount the 'SoaS.iso' image to reach the onboard livecd-iso-to-disk installation script:
** Alternatively, with 3 available loop devices, loop mount the 'SoaS.iso' image to reach the onboard livecd-iso-to-disk script:
: {{Code|sudo mkdir /mnt/soas/}}
**: {{Code|mkdir /mnt/soas/}}
: {{Code|sudo mount /path/to/Fedora-16-x86_64-Live-SoaS.iso /mnt/soas/}}
**: {{Code|mount /path/to/Fedora-13-i686-Live-SoaS.iso /mnt/soas/}}
:: (mount: warning: /mnt/soas/ seems to be mounted read-only.)
**:: (mount: warning: /mnt/soas/ seems to be mounted read-only.)
* Change the working directory to the LiveOS folder on the SoaS.iso mount:
**: {{Code|mkdir /mnt/squash/}}
: {{Code|cd /mnt/soas/LiveOS}}
**: {{Code|mount /mnt/soas/LiveOS/squashfs.img /mnt/squash/}}
* Execute {{Code|./livecd-iso-to-disk --help}} for usage details. (The file is already executable.)
**: {{Code|mkdir /mnt/ext3fs/}}
**: {{Code|mount /mnt/squash/LiveOS/ext3fs.img /mnt/ext3fs/}}
**:: Later below, substitute {{Code|/mnt/ext3fs/LiveOS/livecd-iso-to-disk}} for the shell script name (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'''csi</abbr> '''d'''evice is /dev/sdb and filesystem partition on that device is /dev/sdb1:
* Check the USB device node name on your system. In the example below, the <abbr title="small computer system interface">'''s'''csi</abbr> '''d'''evice is /dev/sdc and filesystem partition on that device is /dev/sdc1:
: {{Code|df -Th}}
<pre>
<pre>
$ df -Th
$ df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext4    18G 5.6G  12G  33% /
rootfs      rootfs    20G  12G  7.5G  61% /
tmpfs        tmpfs    1.6G 536K 1.6G  1% /dev/shm
udev      devtmpfs    1.6G    0  1.6G  0% /dev
/dev/sdb1     vfat   996M     0  996M   0% /media/MyUSBdiscMountpoint
tmpfs        tmpfs    1.6G  904K  1.6G  1% /dev/shm
tmpfs        tmpfs    1.6G  788K  1.6G  1% /run
/dev/sda2     ext4    20G  12G  7.5G  61% /
tmpfs        tmpfs    1.6G    0 1.6G  0% /sys/fs/cgroup
tmpfs        tmpfs    1.6G     0 1.6G  0% /media
/dev/sda2    ext4    20G  12G  7.5G  61% /tmp
/dev/sda2    ext4    20G  12G  7.5G  61% /var/tmp
/dev/sda2     ext4    20G  12G  7.5G  61% /home
/dev/loop0 iso9660   443M  443M     0 100% /mnt/soas
/dev/sdc1    vfat    3.8G 4.0K  3.8G   1% /media/MyUSBdiscMountPoint
</pre>
</pre>


* Unmount the drive,<br>
* Unmount the drive,<br>
: {{Code|sudo umount /media/MyUSBdiscMountpoint}}
: {{Code|sudo umount /media/MyUSBdiscMountPoint}}


* Then check to see that the partition is marked as bootable,<br>
* Then check to see that the partition is marked as bootable,<br>
: {{Code|sudo fdisk '''-l'''}} ''<----that's a lowercase letter 'L' for the '''l'''ist option.''
: {{Code|sudo fdisk '''-l''' /dev/sdc}} ''<----that's a lowercase letter 'L' for the '''l'''ist option.''
You should see output that looks like this:
You should see output that looks like this:
Disk /dev/sdb: 1047 MB, 1047265280 bytes
<pre>
255 heads, 63 sectors/track, 127 cylinders
$ sudo fdisk -l /dev/sdc
Units = cylinders of 16065 * 512 = 8225280 bytes
 
Disk identifier: 0x0008325f
Disk /dev/sdc: 4012 MB, 4012900352 bytes
.
124 heads, 62 sectors/track, 1019 cylinders, total 7837696 sectors
  Device Boot      Start        End      Blocks  Id  System
Units = sectors of 1 * 512 = 512 bytes
/dev/sdb1   *           1        127     1020096   6 FAT16
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000a9c7
 
  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1   *         62    7834071     3917005   c W95 FAT32 (LBA)
</pre>
The '*' under the Boot column is what you want to see.
The '*' under the Boot column is what you want to see.
: If not, then
{{Show|&nbsp;&nbsp;&nbsp;&nbsp;If not, then|
:* For Ubuntu 8.10, menu: System -> Administration -> Partition Editor (GParted).
:* For Ubuntu 8.10, menu: System -> Administration -> Partition Editor (GParted).
::# Select your USB device (/dev/sd''b'' for the rest of these instructions),
::# Select your USB device (/dev/sd''b'' for the rest of these instructions),
Line 68: Line 79:


:* For Fedora,
:* For Fedora,
::#  {{Code|parted /dev/sd''b''}}
::#  {{Code|parted /dev/sd''c''}}
::# {{Code|toggle 1 boot}}
::# {{Code|toggle 1 boot}}
::# {{Code|quit}}
::# {{Code|quit}}
}}


* (You may need to change the file mode to make the script executable.)
* 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.
: {{Code|chmod +x tools_livecd-iso-to-disk.sh}}
: {{Code|sudo ./livecd-iso-to-disk --reset-mbr --overlay-size-mb '''500''' --home-size-mb '''900''' --delete-home --unencrypted-home /path/to/SoaS.iso /dev/sd'''c'''1}}
* 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.
:: (In the above example, the /path/to/SoaS.iso may be substituted with /dev/loop0, as this is the loop device that the mount command chose.)
*: {{Code|sudo ./tools_livecd-iso-to-disk.sh --reset-mbr --overlay-size-mb 500 --home-size-mb 900 --delete-home --unencrypted-home /path/to/SoaS.iso /dev/sd''b1''}}
:: {{Highlight|'''Note''': 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 script downloaded after 15 February 2011 (but not those installed by other methods) by running this command from a root user Terminal window:}}
** {{Highlight|'''Note''': Subsequent USB or SD devices may be installed from a running ''Sugar on a Stick'' image that was installed with the livecd-iso-to-disk script downloaded after 15 February 2011 (but not those installed by other methods) by running this command from a root user Terminal window:}}
:: {{Code|/mnt/live/LiveOS/livecd-iso-to-disk --reset-mbr --overlay-size-mb '''500''' --home-size-mb '''900''' --delete-home --unencrypted-home /dev/sr0 /dev/sd'''?'''1}}
**: {{Code|/LiveOS/livecd-iso-to-disk --reset-mbr --overlay-size-mb 500 --home-size-mb 900 --delete-home --unencrypted-home /dev/sr0 /dev/sd?1}}
: The ''livecd-iso-to-disk'' installation method has other advantages over the ''liveusb-creator'' method by allowing the creation of a separate,  persistent /home/liveuser folder with the <tt>--home-size-mb ''NNN''</tt> option. This feature avoids consumption of the write-once 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 ''livecd-iso-to-disk'' installation method has other advantages over the ''liveusb-creator'' method by allowing the creation of a separate,  persistent /home/liveuser folder with the <tt>--home-size-mb ''NNN''</tt> option. This feature avoids consumption of the write-once 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 {{Code|--delete-home}} option is used to avoid an error message while requesting both a new home (with {{Code|--home-size-mb}}) and a persistent home (indirectly with {{Code|--unencrypted-home}}). You wouldn't use the --delete-home option on an upgrade of the operation system only.
::* The {{Code|--delete-home}} option is used to avoid an error message while requesting both a new home (with {{Code|--home-size-mb}}) and a persistent home (indirectly with {{Code|--unencrypted-home}}). You wouldn't use the --delete-home option on an upgrade of the operation system only.