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
dcore:usb_installation_test-drive [2016/05/17 06:53] – [Persistence for regular files] nitramdcore:usb_installation_test-drive [2018/12/10 19:09] (current) – [dCore Test Drive on a USB Stick (Beginners 101)] jason w
Line 1: Line 1:
 ====== dCore Test Drive on a USB Stick (Beginners 101) ====== ====== dCore Test Drive on a USB Stick (Beginners 101) ======
 Take dCore for a spin to understand how it works! Each step is performed manually first before it is eventually automated. Altogether it will lead to a more or less complete installation and deeper understanding of dCore. Take dCore for a spin to understand how it works! Each step is performed manually first before it is eventually automated. Altogether it will lead to a more or less complete installation and deeper understanding of dCore.
-===== Overview =====+ 
 +=== Burn ISO image to USB and use dCore-usbinstall === 
 +The easiest way to install dCore to USB is to download a dCorePlus ISO.  Below are some links to release candidate dCorePlus images: 
 + 
 +[[http://tinycorelinux.net/dCore/x86/release_candidates/dCore-bionic/dCorePlus-bionic.iso|dCorePlus-bionic.iso]] 
 + 
 +[[http://tinycorelinux.net/dCore/x86/release_candidates/dCore-bionic/dCorePlus-bionic.iso.md5.txt|dCorePlus-bionic.iso.md5.txt]] 
 + 
 + 
 +[[http://tinycorelinux.net/dCore/x86_64/release_candidates/dCore-bionic64/dCorePlus-bionic64.iso|dCorePlus-bionic64.iso]] 
 + 
 +[[http://tinycorelinux.net/dCore/x86_64/release_candidates/dCore-bionic64/dCorePlus-bionic64.iso.md5.txt|dCorePlus-bionic64.iso.md5.txt]] 
 + 
 + 
 +[[http://tinycorelinux.net/dCore/x86/release_candidates/dCore-stretch/dCorePlus-stretch.iso|dCorePlus-stretch.iso]] 
 + 
 +[[http://tinycorelinux.net/dCore/x86/release_candidates/dCore-stretch/dCorePlus-stretch.iso.md5.txt|dCorePlus-stretch.iso.md5.txt]] 
 + 
 + 
 +[[http://tinycorelinux.net/dCore/x86_64/release_candidates/dCore-stretch64/dCorePlus-stretch64.iso|dCorePlus-stretch64.iso]] 
 + 
 +[[http://tinycorelinux.net/dCore/x86_64/release_candidates/dCore-stretch64/dCorePlus-stretch64.iso.md5.txt|dCorePlus-stretch64.iso.md5.txt]] 
 + 
 +In Windows, there are utilities like Rufus and Unetbootin, the latter also available for linux.  To install Unetbootin, add the following PPA if using Ubuntu: 
 + 
 +ppa:gezakovacs/ppa 
 + 
 +The simplest but least safe way to write an ISO to USB is using the dd command, but one must be absolute certain of their device name or data loss can occur.  To find which drives on the system are USB, the below command will list them: 
 + 
 +<code> 
 +for I in `ls /dev/disk/by-id/ | grep usb`; do E=`readlink /dev/disk/by-id/"$I" | sed 's/[0-9]*//g' | sed "s/[./]//g"`;  echo ""$E"_"$I"" ; done 
 +</code> 
 + 
 +If your USB device is /dev/sdb, then the following command will write the dCorePlus ISO to the USB: 
 + 
 +<code> 
 +dd if=dCorePlus-stretch64.iso of=/dev/sdb 
 +</code> 
 + 
 +Now you are ready for the initial boot of the USB to set up the final install.  Reboot and set up internet connection.  Then issue the following commands from a terminal window: 
 + 
 +<code> 
 +sce-import dCore-usbinstall 
 +sce-load dCore-usbinstall 
 +sudo dCore-usbinstall 
 +</code> 
 + 
 +The USB will not be mounted after booting with the ISO written to it, so the same USB can be used to install to.  dCore-usbinstall will guide you through choices between x86 and x86_64, BIOS and UEFI, release and release candidates, and which dCore port you wish to install.  It will create a bootable USB formatted with ext2 and the TCE directory will be located on the USB and used during future boots.  
 + 
 +The following below is a more hands-on method of installing dCore to USB. 
 + 
 +=== Manual install to USB ===
 dCore will be installed on a USB-stick. The system basically consists of the following files: dCore will be installed on a USB-stick. The system basically consists of the following files:
   - Linux kernel and initial RAM disk, typically named 'vmlinuz' and 'core.gz'   - Linux kernel and initial RAM disk, typically named 'vmlinuz' and 'core.gz'
Line 10: Line 61:
 All these files or folders may well reside on any type of file system, even ones not respecting Linux permissions.  All these files or folders may well reside on any type of file system, even ones not respecting Linux permissions. 
  
-=== Optional Steps ===+===== Optional Steps =====
 The user data in '/opt/' or '/home/' could well be stored on a partition of its own with a Linux file system. We shall not endeavour to doing so here, however. The user data in '/opt/' or '/home/' could well be stored on a partition of its own with a Linux file system. We shall not endeavour to doing so here, however.
 ===== Building blocks for a basic desktop installation ===== ===== Building blocks for a basic desktop installation =====
Line 127: Line 178:
 At the moment, it does not contain much but by clicking anywhere on the desktop, an Flwm menu opens, giving you access to terminal, editor etc. After a playful moment, exit back to the command line prompt. At the moment, it does not contain much but by clicking anywhere on the desktop, an Flwm menu opens, giving you access to terminal, editor etc. After a playful moment, exit back to the command line prompt.
  
-===== Automatically Boot Into The Graphcial Environment =====+===== Automatically Boot Into a Graphical Environment =====
 The previous steps have to be repeated after every boot: The previous steps have to be repeated after every boot:
   - set the tce-directory   - set the tce-directory
Line 193: Line 244:
 There is one major draw-back to this approach; namely that files actually "live" in RAM and are only copied to persistent storage upon request, for instance at shutdown. Seen the other way, one gains the choice if a session should be stored (backed up) or not. There is one major draw-back to this approach; namely that files actually "live" in RAM and are only copied to persistent storage upon request, for instance at shutdown. Seen the other way, one gains the choice if a session should be stored (backed up) or not.
  
-==== Note about persistent file systems ====+=== Note About Persistent File Systems ===
 If one wanted to keep persistent storage on a separate file system, the Kernel would have to know about its location already during the boot process. For specifying a file system, the [[http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes|boot codes]] ''home'' and ''opt'' are used. If one wanted to keep persistent storage on a separate file system, the Kernel would have to know about its location already during the boot process. For specifying a file system, the [[http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes|boot codes]] ''home'' and ''opt'' are used.
  
Line 200: Line 251:
 === Terminology === === Terminology ===
 Oftentimes, the usage of persistent file systems is coined "persistent home" or "persistent opt", respectively. We use the term persistent here in the sense of not ephemeral. Oftentimes, the usage of persistent file systems is coined "persistent home" or "persistent opt", respectively. We use the term persistent here in the sense of not ephemeral.
-==== 'mydata.tgz' ====+=== 'mydata.tgz' ===
 All user files are wrapped up in the archive file 'mydata.gz' that resides in the root of the tce-directory. This file does not need to be touched as its content is un-packed by dCore, providing the home- as well as the opt-directory. All user files are wrapped up in the archive file 'mydata.gz' that resides in the root of the tce-directory. This file does not need to be touched as its content is un-packed by dCore, providing the home- as well as the opt-directory.
  
Line 212: Line 263:
 === '/opt/.xfiletool.lst' === === '/opt/.xfiletool.lst' ===
 Complementary, there is '.xfiletool.lst' which lists files to be excluded from the backup. This file obeys to different semantics than '.filetool.lst'. Indeed, the entries are [[http://www.gnu.org/software/tar/manual/tar.html#SEC109|patterns]] as used by the command ''tar''. Briefly put, they describe the **ending** of a file, including its path. Complementary, there is '.xfiletool.lst' which lists files to be excluded from the backup. This file obeys to different semantics than '.filetool.lst'. Indeed, the entries are [[http://www.gnu.org/software/tar/manual/tar.html#SEC109|patterns]] as used by the command ''tar''. Briefly put, they describe the **ending** of a file, including its path.
-==== Backup ====+=== Backup ===
 When exiting from the graphical desktop, a selection window is presented with options to shutdown, reboot and a drop-down menu for the backup options. We shall discuss these in a moment. When exiting from the graphical desktop, a selection window is presented with options to shutdown, reboot and a drop-down menu for the backup options. We shall discuss these in a moment.
  
Line 234: Line 285:
 NB: do not mistake 'filetool.sh' for 'filetool', the latter being a graphical wrapper of the former. NB: do not mistake 'filetool.sh' for 'filetool', the latter being a graphical wrapper of the former.
  
-=== Restoring files ===+=== Restoring Files ===
 If a file is erroneously deleted then it can be restored from 'mydata.gz', provided no backup has happened yet. Let's for example ''rm ~/Pers-test'' and restore it by ''filetool.sh -rv''. If a file is erroneously deleted then it can be restored from 'mydata.gz', provided no backup has happened yet. Let's for example ''rm ~/Pers-test'' and restore it by ''filetool.sh -rv''.
  
-=== Backup from the graphical desktop ===+=== Backup from the Graphical Desktop ===
 Shutting down the graphical desktop, the backup command can be triggered in the selection window. Shutting down the graphical desktop, the backup command can be triggered in the selection window.
  
-=== Safe backup ===+=== Safe Backup ===
 In the graphical desktop, one can choose "Safe" as backup option. This means that an already existing 'mydata.tgz' is copied to 'mydata**bk**.tgz' before overwriting it with the new state. In the graphical desktop, one can choose "Safe" as backup option. This means that an already existing 'mydata.tgz' is copied to 'mydata**bk**.tgz' before overwriting it with the new state.
 This is equivalent to ''filetool.sh -s''. This is equivalent to ''filetool.sh -s''.
Line 246: Line 297:
 If need be, the old version 'mydatabk.tgz' can be substituted for the new version or stored away under a different name. If need be, the old version 'mydatabk.tgz' can be substituted for the new version or stored away under a different name.
  
-=== Getting rid of persistent files ===+=== Getting Rid of Persistent Files ===
 For files in '/home/' or '/opt/' it suffices to simply delete them and trigger a backup. Files like '/etc/Conf-test' must be excluded from '.filetool.lst' in addition. This can be done by launching ''vi /opt/.filetool.lst'', moving to the desired line with the arrow keys and hitting the 'D'-key twice. Save and quit by hitting ''Esc : w q'' or quit without saving by hitting ''Esc : q !''. Of course, one may achieve the same in the graphical desktop by launching the editor (which is provided by the //Xprogs// extension, BTW; cf. the [[#A graphical environment|aside]] above). For files in '/home/' or '/opt/' it suffices to simply delete them and trigger a backup. Files like '/etc/Conf-test' must be excluded from '.filetool.lst' in addition. This can be done by launching ''vi /opt/.filetool.lst'', moving to the desired line with the arrow keys and hitting the 'D'-key twice. Save and quit by hitting ''Esc : w q'' or quit without saving by hitting ''Esc : q !''. Of course, one may achieve the same in the graphical desktop by launching the editor (which is provided by the //Xprogs// extension, BTW; cf. the [[#A graphical environment|aside]] above).
  
 Now get rid of the three test files for good and go take some [[https://en.wikibooks.org/wiki/Learning_the_vi_Editor/BusyBox_vi|lessons in Vi]] if necessary! Now get rid of the three test files for good and go take some [[https://en.wikibooks.org/wiki/Learning_the_vi_Editor/BusyBox_vi|lessons in Vi]] if necessary!
  
-=== Note about location of 'mydata.tgz' and '.filetool.lst' ===+=== Note about 'mydata.tgz' and '.filetool.lst' ===
 The location or, more precisely, the full path and name of the file used for storing persistent user data, is read from '/etc/sysconfig/mydata' which can be specified through the [[http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes|boot-code]] 'mydata'. The location or, more precisely, the full path and name of the file used for storing persistent user data, is read from '/etc/sysconfig/mydata' which can be specified through the [[http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes|boot-code]] 'mydata'.
  
 Similarily, the choice of files to be extracted from persistent user data into the root file system can be specified by an arbitrary file named 'yyy.lst' within the given tce-directory through the [[http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes|boot-code]] 'lst'. Similarily, the choice of files to be extracted from persistent user data into the root file system can be specified by an arbitrary file named 'yyy.lst' within the given tce-directory through the [[http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes|boot-code]] 'lst'.
  
-===== Automatically run commands =====+===== Automatically Run Commands =====
 The [[#Automatically boot into the graphcial environment|above catalogue]] of desirable features has only been partially completed. The crucial point being "issue startup commands for applications" The [[#Automatically boot into the graphcial environment|above catalogue]] of desirable features has only been partially completed. The crucial point being "issue startup commands for applications"
  
Line 270: Line 321:
   - '~/.ashrc' can be used as usual   - '~/.ashrc' can be used as usual
   - '~/.xinitrc' calls alls cripts under '~/X.d/', so individual auto-start settings can be stored there.   - '~/.xinitrc' calls alls cripts under '~/X.d/', so individual auto-start settings can be stored there.
-==== 'bootlocal.sh', 'bootsync.sh', 'shutdown.sh' ====+=== 'bootlocal.sh', 'bootsync.sh', 'shutdown.sh' ===
 These files, residing in '/opt/', are shell scripts, interpreted by an Almquist shell ('ash'). These files, residing in '/opt/', are shell scripts, interpreted by an Almquist shell ('ash').
   * 'bootsync.sh' is executed at system startup. Its commands are meant be terminated before moving on; i.e. they should //not// be made running in the background by adding a ampersand sign ('&'). As such they may influence the duration of the boot process.   * 'bootsync.sh' is executed at system startup. Its commands are meant be terminated before moving on; i.e. they should //not// be made running in the background by adding a ampersand sign ('&'). As such they may influence the duration of the boot process.
Line 280: Line 331:
 These files run with root privileges and, accordingly, can only be manipulated as root user, so one must use ''sudo vi'' (or ''sudo editor'' in the GUI). These files run with root privileges and, accordingly, can only be manipulated as root user, so one must use ''sudo vi'' (or ''sudo editor'' in the GUI).
  
-=== Simple examples ===+=-= Simple Examples ===
 Let's, for example, generate a symbolic link '/tce' in the root of the file system to the tce-directory '/etc/sysconfig/tcedir/'. Furthermore, we want to remove the //pcspkr// kernel module in order to get rid of that bleepin' beeping! Let's, for example, generate a symbolic link '/tce' in the root of the file system to the tce-directory '/etc/sysconfig/tcedir/'. Furthermore, we want to remove the //pcspkr// kernel module in order to get rid of that bleepin' beeping!
 The following commands will add appropriate lines to '/opt/bootlocal.sh'. The following commands will add appropriate lines to '/opt/bootlocal.sh'.
Line 289: Line 340:
 Don't forget to trigger a backup before rebooting! Don't forget to trigger a backup before rebooting!
  
-== Note about black-listing kernel modules ==+=== Note About Blacklisting Kernel Modules ===
 The black-listing of kernel modules can also be achieved via [[http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes|boot codes]]. In case one should not have been able to say aloud "bleepin' beeping" five times in a row without mis-spelling, one should include ''blacklist=pcspkr'' (also compare the discussion in the [[http://forum.tinycorelinux.net/index.php/topic,12133.0.html|forum]]) into the boot-stanza. The black-listing of kernel modules can also be achieved via [[http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes|boot codes]]. In case one should not have been able to say aloud "bleepin' beeping" five times in a row without mis-spelling, one should include ''blacklist=pcspkr'' (also compare the discussion in the [[http://forum.tinycorelinux.net/index.php/topic,12133.0.html|forum]]) into the boot-stanza.
-===== Looks =====+===== Summary =====
  
-==== Synopsis ====+=== Synopsis ===
 This sample set-up addressed the following issues: This sample set-up addressed the following issues:
   * Running a basic dCore installation from a FAT32 file system   * Running a basic dCore installation from a FAT32 file system
Line 302: Line 353:
   * Persistently storing user data in 'mydata.tgz' for selected files listed in '.filetool.lst'   * Persistently storing user data in 'mydata.tgz' for selected files listed in '.filetool.lst'
   * Automatically running system command during startup or shutdown   * Automatically running system command during startup or shutdown
-==== Outlook ====+=== Outlook ===
 Where to head from here? Check out the page about Where to head from here? Check out the page about
 [[dcore:installations|installations]] [[dcore:installations|installations]]
Line 316: Line 367:
   * [[dcore:installations#maintenance|upgrading the system]]   * [[dcore:installations#maintenance|upgrading the system]]
  
-=== Further reading ===+=== Further Reading ===
 There are several explanations in the [[dcore:welcome|wiki]] that provide very informative reading after having followed all along. A recommended track consists of a [[dcore:basic_desktop_installation|basic desktop installation]] followed by a [[dcore:migrating_from_flwm_to_lxde|switch to LXDE]]. A study of the techniques for [[dcore:handling_extensions|handling extensions]] is pretty mandatory. There are several explanations in the [[dcore:welcome|wiki]] that provide very informative reading after having followed all along. A recommended track consists of a [[dcore:basic_desktop_installation|basic desktop installation]] followed by a [[dcore:migrating_from_flwm_to_lxde|switch to LXDE]]. A study of the techniques for [[dcore:handling_extensions|handling extensions]] is pretty mandatory.
  
 +**[[http://wiki.tinycorelinux.net/dcore:welcome|> Return to the dCore Wiki Welcome page]]**
Print/export
QR Code
QR Code dcore:usb_installation_test-drive (generated for current page)