Difference between revisions of "Installation/Live Images/USB-Stick for OFW11"

From OpenFOAMWiki
(Kicked off this page with the list of instructions I already have)
 
(Preface: Added link to the CFD-Online announcement)
 
(52 intermediate revisions by the same user not shown)
Line 1: Line 1:
<span style="font-size:180%">'''WARNING: These instructions are currently being written and under testing!'''</span>
+
= Preface =
 +
This section of the wiki ([[Installation/Live_Images/USB-Stick for OFW11]]) has been written as the most detailed as possible set of instructions on how to create, successfully massively-deploy USB-sticks and alter use those USB-sticks that run Lubuntu with the all of the OpenFOAM technology software that was available up to a few months from when the [http://www.cfd-online.com/Forums/openfoam-news-announcements-other/165818-11th-openfoam-workshop-26-30-june-2016-guimaraes-portugal.html 11th OpenFOAM Workshop is/was held in 2016 at Guimarães in Portugal]. Website at the time: [http://openfoamworkshop.org/ openfoamworkshop.org]
 +
: ([[User:Wyldckat|Wyldckat]] ([[User talk:Wyldckat|talk]]) 17:45, 13 February 2016 (CET): Don't forget to update when it's mirrored onto openfoam-extend's project at SourceForge.net.)
  
== Reminders ==
+
<br>
* {{tt|sdX}} refers to the device itself for the USB drive.
+
* {{tt|sdX1}} refers to the first partition.
+
* You can find the actual device identification if you use the auto-mount feature that Linux Distributions provide to explore the drive's contents. Then run:
+
<bash>mount</bash>
+
and the last entry is likely the one related to the USB drive, assuming it's the latest one mounted in the system. For example, it may show this:
+
<bash>/dev/sdf1 on /media/ofuser/F361-E869 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
+
</bash>
+
which means that:
+
** {{tt|/dev/sdf}} is the drive's device identification path;
+
** {{tt|/dev/sdf1}} is the drive's first partition path.
+
  
 +
= Objective =
 +
'''To make it 100% probable that everyone will be able to use OpenFOAM and foam-extend at the 11th OpenFOAM Workshop.''' Although this might be limited to 100% of the people that have 64-bit PCs...
  
== Commands for formatting USB pen drive ==
+
<br>
 +
= Instructions =
  
These steps are dedicated for creating a pen drive with a partition size that should fit all 8GB USB drives, including those that _lie_ about their total size, such as those that really only have around 7,750,000,000 bytes. The following instructions aim for a primary partition of 7,654,604,800 bytes.
+
This is aimed at providing a fully functional USB-stick or Virtual Machine Appliance that works on VirtualBox, so that [http://openfoam.org OpenFOAM] and [http://foam-extend.org foam-extend] can be accessed without going through the occasionally tough installation process. Nonetheless , keep in mind that [http://www.docker.com Docker] is the kind of technology that will probably supersede this kind of installation in future workshops.
  
Steps:
+
The information written for this topic are spread across the following sub-pages:
# Switch to root or keep in mind to do the command with {{tt|sudo}}.
+
; [[Installation/Live_Images/USB-Stick_for_OFW11/User_Guide|User Guide]]
# First of all, unmount the partition that it probably auto-mounted:
+
: This is the User Guide meant for the people who will be trying to use these images and/or virtual machines. It also lists the software versions installed with the image designed for this workshop.
<bash>umount /dev/sdX1</bash>
+
# For creating the partition:
+
<bash>fdisk /dev/sdX
+
d  #delete
+
o  #create DOC partition table
+
c  #toggle DOS compatibility
+
  
#should show:
+
; [[Installation/Live_Images/USB-Stick_for_OFW11/Reminders|Reminders]]
#  DOS Compatibility flag is set (DEPRECATED!)
+
: This page is needed for the next couple of pages, because this provides the main details that should be kept at all times when following the instructions on those other pages!
  
n  #new partition
+
; [[Installation/Live_Images/USB-Stick_for_OFW11/Deployment_Guide|Deployment Guide]]
p  #new partition
+
: This page is meant for the people responsible for the deployment phase, namely those who will be ''sweating'' to burn the image onto several dozens (if not a couple of hundred) USB sticks.
1  #partition 1
+
: It also includes information on how to create the virtual machine appliances, in case things don't run so well when trying to use the USB-stick as a ''bootable'' drive.
62    #first sector
+
+7300M  #end sector, as size in MB
+
  
t  #change type
+
; [[Installation/Live_Images/USB-Stick_for_OFW11/Creation_Guide|Creation Guide]]
c  #change to W95 FAT32 (LBA)
+
: This is where the complete instructions for the creation of the USB-stick are written and provide as many details as possible.
  
a  #make it bootable
+
; [[Installation/Live_Images/USB-Stick_for_OFW11/Download|Download]]
 +
: This is where is listed the current locations for the (virtual) disk images.
  
p  #prints current table on screen make a note of the shown values, because you're going to need the End sector number
+
; [[Installation/Live_Images/USB-Stick_for_OFW11/FAQ|Frequently Asked Questions]]
 
+
: This page is for the Frequently Asked Questions about this particular effort for the OFW11.
w  #write partition table
+
</bash>
+
#* Note: Make sure you have the units in sectors:
+
<bash>u  # use as many times as possible until it shows
+
 
+
#Changing display/entry units to sectors
+
</bash>
+
# '''Optional''' - Full clean up of partition:
+
<bash>dd if=/dev/zero of=/dev/sdX1 bs=512<bash>
+
## In another terminal (also as root), tun:
+
<bash>while killall -USR1 dd; do sleep 30; done</bash>
+
## Then look at the previous terminal window and every 30 seconds it should update on the current write status. Given how this command works, if you have more than one {{tt|dd}} running, it will update for all running {{tt|dd}} applications.
+
## It will probably end with the message:
+
<bash>dd: error writing ‘/dev/sdX1’: No space left on device</bash>
+
because we didn't define the total number of bytes/blocks to write.
+
## Once completed, make sure it's fully written by running:
+
<bash>sync</bash>
+
wait until it returns control back to you.
+
# Once complete, then for formatting the partition properly:
+
<bash>mkfs -t vfat /dev/sdX1</bash>
+
 
+
 
+
== Creating the live USB ==
+
'''Tested with Lubuntu 15.04 x86_64.'''
+
 
+
Need to have {{tt|usb-creator-gtk}} installed and we will be using Lubuntu 64-bit as the basis for our pen drives. In addition, it's advisable to do these steps from a working installation of the desired Lubuntu version, even if it's within a virtual machine.
+
 
+
# As root (or with {{tt|sudo}}), run:
+
<bash>usb-creator-gtk</bash>
+
# Select the ISO for the Lubuntu Live CD/DVD.
+
# Select the pen drive you want as the target for the Live USB.
+
#* '''Note''': Do not use the erase function, otherwise you will loose the correct booting mechanism that was created with {{tt|fdisk}} and {{tt|mkfs}}.
+
# Select the largest possible "Stored in reserved extra space", at least taking into account how much will be left over for the _read-anywhere_ files, such as presentations and VM installers.
+
#* For example:
+
#** 690 MiB for the cloned Live CD
+
#** 1.0 GiB for the _read-anywhere_ data.
+
#** 7.1 GiB - 1.0 GiB - 690 MiB = 5.42 GiB = 5556.4 MiB... which is larger than 4GiB, the file size limit for FAT32 partitions.
+
# Finally, click on the "Make Startup Disk" button and wait a while for it to run...
+
 
+
 
+
=== Transferring the local installation to the persistent partition file in the drive ===
+
 
+
'''Note''': These instructions will mount and transfer the files directly to the persistent file in the USB drive, so you might want to not operate directly on this file.
+
* If so, copy the file {{tt|casper-rw}} to a local disk and roughly follow the steps accordingly with the new path for the file.
+
 
+
Steps:
+
# Mount the pen with the interactive mount that Lubuntu has got from the file manager.
+
# As root (or with {{tt|sudo}}), run:
+
<bash>mkdir /mnt/casper
+
mount -t auto /media/$USER/*/casper-rw /mnt/casper/ -o loop
+
</bash>
+
# The _persistent_ home folder will now be located at {{tt|/mnt/casper/upper/home/lubuntu/}}:
+
<bash>cd /mnt/casper/upper/home/lubuntu/</bash>
+
If it doesn't exist, then create it and change owership:
+
<bash>mkdir -p /mnt/casper/upper/home/lubuntu/
+
chown -R 999:999 /mnt/casper/upper/home/lubuntu/</bash>
+
# When you're done copying files to the image, make sure the _persistent_ home folder has the correct owner permissions:
+
<bash>chown -R 999:999 /mnt/casper/upper/home/lubuntu/</bash>
+
# Then unmount it:
+
<bash>umount /mnt/casper</bash>
+
# Also unmount the pen:
+
<bash>umount /dev/sdX1</bash>
+
 
+
 
+
== Cloning the original pen to a new image ==
+
 
+
Steps:
+
# Make sure you don't have the pen mounted! Example to umount:
+
<bash>umount /dev/sdX1</bash>
+
# As root (or with {{tt|sudo}}), run:
+
<bash>dd if=/dev/sdX of=OFW11-2015_v1.img bs=512 count=14950463</bash>
+
#* The value "14950463" is the End sector count 14950462 plus 1.
+
#* 14950463 sector * 512 B/sector = 7654636544 B = 7654636544 ~= 7300 MiB
+
## In another terminal (also as root), tun:
+
<bash>while killall -USR1 dd; do sleep 30; done</bash>
+
## Then look at the previous terminal window and every 30 seconds it should update on the current write status. Given how this command works, if you have more than one {{tt|dd}} running, it will update for all running {{tt|dd}} applications.
+
# When it's done cloning, make sure the file system is synced:
+
<bash>sync</bash>
+
wait until it returns control back to you.
+
# Now you can mount the pen again, if you want. Or simply eject it.
+
 
+
 
+
== Cloning the image to a new pen ==
+
 
+
It's almost the reverse of the previous steps:
+
# Make sure you don't have the pen mounted! Example to umount:
+
<bash>umount /dev/sdX1</bash>
+
# As root (or with {{tt|sudo}}), run:
+
<bash>dd if=OFW11-2015_v1.img of=/dev/sdX bs=512</bash>
+
## In another terminal (also as root):
+
<bash>ps -a</bash>
+
## In another terminal (also as root), tun:
+
<bash>while killall -USR1 dd; do sleep 30; done</bash>
+
## Then look at the previous terminal window and every 30 seconds it should update on the current write status. Given how this command works, if you have more than one {{tt|dd}} running, it will update for all running {{tt|dd}} applications.
+
# When it's done cloning, make sure the file system is synced:
+
<bash>sync</bash>
+
wait until it returns control back to you.
+
# Now you can mount the pen, if you want. Or simply eject it.
+
  
 +
<br>
  
 +
= Full list of  sub-pages =
 +
Here is the complete  list of sub-pages for this current page, just in case something is missing when reading the manually compiled reading structure given in the chapter(s) above: {{subpages|Installation/Live Images/USB-Stick for OFW11}}
  
 
[[Category:Live OS Images]]
 
[[Category:Live OS Images]]

Latest revision as of 21:24, 13 February 2016

1 Preface

This section of the wiki (Installation/Live_Images/USB-Stick for OFW11) has been written as the most detailed as possible set of instructions on how to create, successfully massively-deploy USB-sticks and alter use those USB-sticks that run Lubuntu with the all of the OpenFOAM technology software that was available up to a few months from when the 11th OpenFOAM Workshop is/was held in 2016 at Guimarães in Portugal. Website at the time: openfoamworkshop.org

(Wyldckat (talk) 17:45, 13 February 2016 (CET): Don't forget to update when it's mirrored onto openfoam-extend's project at SourceForge.net.)


2 Objective

To make it 100% probable that everyone will be able to use OpenFOAM and foam-extend at the 11th OpenFOAM Workshop. Although this might be limited to 100% of the people that have 64-bit PCs...


3 Instructions

This is aimed at providing a fully functional USB-stick or Virtual Machine Appliance that works on VirtualBox, so that OpenFOAM and foam-extend can be accessed without going through the occasionally tough installation process. Nonetheless , keep in mind that Docker is the kind of technology that will probably supersede this kind of installation in future workshops.

The information written for this topic are spread across the following sub-pages:

User Guide
This is the User Guide meant for the people who will be trying to use these images and/or virtual machines. It also lists the software versions installed with the image designed for this workshop.
Reminders
This page is needed for the next couple of pages, because this provides the main details that should be kept at all times when following the instructions on those other pages!
Deployment Guide
This page is meant for the people responsible for the deployment phase, namely those who will be sweating to burn the image onto several dozens (if not a couple of hundred) USB sticks.
It also includes information on how to create the virtual machine appliances, in case things don't run so well when trying to use the USB-stick as a bootable drive.
Creation Guide
This is where the complete instructions for the creation of the USB-stick are written and provide as many details as possible.
Download
This is where is listed the current locations for the (virtual) disk images.
Frequently Asked Questions
This page is for the Frequently Asked Questions about this particular effort for the OFW11.


4 Full list of sub-pages

Here is the complete list of sub-pages for this current page, just in case something is missing when reading the manually compiled reading structure given in the chapter(s) above:

Installation/Live Images/USB-Stick for OFW11Installation/Live Images/USB-Stick for OFW11/Creation GuideInstallation/Live Images/USB-Stick for OFW11/Deployment Guide
Installation/Live Images/USB-Stick for OFW11/DownloadInstallation/Live Images/USB-Stick for OFW11/FAQInstallation/Live Images/USB-Stick for OFW11/Reminders
Installation/Live Images/USB-Stick for OFW11/User Guide