Bootable Ubuntu live USB with persistence - from command line only [on hold]











up vote
-1
down vote

favorite












I wish to create a step-by-step procedure for myself, specifically for creating a bootable persistent live Ubuntu USB disk from scratch.



I realize this is not an Ubuntu forum, but I ask here because I wish to know all the steps that could apply to any OS or any Unix- or Linux-based OS.



Also, I'd like to learn how to do this entirely from the command line only, beginning from step zero.



Step zero means: I have a USB drive that is not formatted, not partitioned, has no file system, etc.



I wish this USB stick to be able to boot on a systems such as a MacBook Pro (late 2013) running Mac OS (ex. High Sierra), but to run independently of that OS being installed on that machine.



Things I am familiar with:
- Terminal, diskutil, dd
- Ubuntu 18.04.1 iso (have the file)
- Booting from external device on MacBook
- Disks, partitions



Things I know of but do not understand well about:
- grub, grub2, efi



I've had some success using GUI-based tools combined with command line.



Now, I wish to understand how to do the entire process by command line only (either on a Mac or Linux OS), and how it all hangs together.










share|improve this question









New contributor




Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Scott, RalfFriedl, JigglyNaga, roaima, Isaac Nov 27 at 23:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Scott, RalfFriedl, roaima, Isaac

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Your question is too broad. Read the ubuntu documentation on live cd from scratch, and Google the components you do not understand such as squashes then ask a more specific question on a specific part you do not understand
    – Panther
    Nov 27 at 2:33










  • Maybe the following Ubuntu help page will help you, Instructions to make a boot drive, that boots both in UEFI and BIOS mode
    – sudodus
    Nov 27 at 7:13















up vote
-1
down vote

favorite












I wish to create a step-by-step procedure for myself, specifically for creating a bootable persistent live Ubuntu USB disk from scratch.



I realize this is not an Ubuntu forum, but I ask here because I wish to know all the steps that could apply to any OS or any Unix- or Linux-based OS.



Also, I'd like to learn how to do this entirely from the command line only, beginning from step zero.



Step zero means: I have a USB drive that is not formatted, not partitioned, has no file system, etc.



I wish this USB stick to be able to boot on a systems such as a MacBook Pro (late 2013) running Mac OS (ex. High Sierra), but to run independently of that OS being installed on that machine.



Things I am familiar with:
- Terminal, diskutil, dd
- Ubuntu 18.04.1 iso (have the file)
- Booting from external device on MacBook
- Disks, partitions



Things I know of but do not understand well about:
- grub, grub2, efi



I've had some success using GUI-based tools combined with command line.



Now, I wish to understand how to do the entire process by command line only (either on a Mac or Linux OS), and how it all hangs together.










share|improve this question









New contributor




Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by Scott, RalfFriedl, JigglyNaga, roaima, Isaac Nov 27 at 23:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Scott, RalfFriedl, roaima, Isaac

If this question can be reworded to fit the rules in the help center, please edit the question.













  • Your question is too broad. Read the ubuntu documentation on live cd from scratch, and Google the components you do not understand such as squashes then ask a more specific question on a specific part you do not understand
    – Panther
    Nov 27 at 2:33










  • Maybe the following Ubuntu help page will help you, Instructions to make a boot drive, that boots both in UEFI and BIOS mode
    – sudodus
    Nov 27 at 7:13













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I wish to create a step-by-step procedure for myself, specifically for creating a bootable persistent live Ubuntu USB disk from scratch.



I realize this is not an Ubuntu forum, but I ask here because I wish to know all the steps that could apply to any OS or any Unix- or Linux-based OS.



Also, I'd like to learn how to do this entirely from the command line only, beginning from step zero.



Step zero means: I have a USB drive that is not formatted, not partitioned, has no file system, etc.



I wish this USB stick to be able to boot on a systems such as a MacBook Pro (late 2013) running Mac OS (ex. High Sierra), but to run independently of that OS being installed on that machine.



Things I am familiar with:
- Terminal, diskutil, dd
- Ubuntu 18.04.1 iso (have the file)
- Booting from external device on MacBook
- Disks, partitions



Things I know of but do not understand well about:
- grub, grub2, efi



I've had some success using GUI-based tools combined with command line.



Now, I wish to understand how to do the entire process by command line only (either on a Mac or Linux OS), and how it all hangs together.










share|improve this question









New contributor




Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I wish to create a step-by-step procedure for myself, specifically for creating a bootable persistent live Ubuntu USB disk from scratch.



I realize this is not an Ubuntu forum, but I ask here because I wish to know all the steps that could apply to any OS or any Unix- or Linux-based OS.



Also, I'd like to learn how to do this entirely from the command line only, beginning from step zero.



Step zero means: I have a USB drive that is not formatted, not partitioned, has no file system, etc.



I wish this USB stick to be able to boot on a systems such as a MacBook Pro (late 2013) running Mac OS (ex. High Sierra), but to run independently of that OS being installed on that machine.



Things I am familiar with:
- Terminal, diskutil, dd
- Ubuntu 18.04.1 iso (have the file)
- Booting from external device on MacBook
- Disks, partitions



Things I know of but do not understand well about:
- grub, grub2, efi



I've had some success using GUI-based tools combined with command line.



Now, I wish to understand how to do the entire process by command line only (either on a Mac or Linux OS), and how it all hangs together.







ubuntu command-line live-usb persistence






share|improve this question









New contributor




Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 27 at 1:18









Rui F Ribeiro

38.3k1476127




38.3k1476127






New contributor




Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 27 at 0:06









Dan

12




12




New contributor




Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Dan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as off-topic by Scott, RalfFriedl, JigglyNaga, roaima, Isaac Nov 27 at 23:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Scott, RalfFriedl, roaima, Isaac

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by Scott, RalfFriedl, JigglyNaga, roaima, Isaac Nov 27 at 23:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – Scott, RalfFriedl, roaima, Isaac

If this question can be reworded to fit the rules in the help center, please edit the question.












  • Your question is too broad. Read the ubuntu documentation on live cd from scratch, and Google the components you do not understand such as squashes then ask a more specific question on a specific part you do not understand
    – Panther
    Nov 27 at 2:33










  • Maybe the following Ubuntu help page will help you, Instructions to make a boot drive, that boots both in UEFI and BIOS mode
    – sudodus
    Nov 27 at 7:13


















  • Your question is too broad. Read the ubuntu documentation on live cd from scratch, and Google the components you do not understand such as squashes then ask a more specific question on a specific part you do not understand
    – Panther
    Nov 27 at 2:33










  • Maybe the following Ubuntu help page will help you, Instructions to make a boot drive, that boots both in UEFI and BIOS mode
    – sudodus
    Nov 27 at 7:13
















Your question is too broad. Read the ubuntu documentation on live cd from scratch, and Google the components you do not understand such as squashes then ask a more specific question on a specific part you do not understand
– Panther
Nov 27 at 2:33




Your question is too broad. Read the ubuntu documentation on live cd from scratch, and Google the components you do not understand such as squashes then ask a more specific question on a specific part you do not understand
– Panther
Nov 27 at 2:33












Maybe the following Ubuntu help page will help you, Instructions to make a boot drive, that boots both in UEFI and BIOS mode
– sudodus
Nov 27 at 7:13




Maybe the following Ubuntu help page will help you, Instructions to make a boot drive, that boots both in UEFI and BIOS mode
– sudodus
Nov 27 at 7:13










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Last I used MacOS I had macports so the following example may require slight adjustment to work on a fresh MacOS install, also read the man pages and be careful not to wipe your system.




  1. wget http://mirror.csclub.uwaterloo.ca/ubuntu-releases/18.04.1/ubuntu-18.04.1-desktop-amd64.iso

  2. sudo -- sh -c 'cat ubuntu-18.04.1-desktop-amd64.iso > /dev/rdisk3 && sync'

  3. boot the Ubuntu live USB via Startup Manager https://support.apple.com/en-us/HT201255

  4. install to a 2nd USB key (or if you don't have one use VirtualBox for #2-3)


If you really want a Live image (with persistent storage on the side) then you can just use Parted (gParted is the GUI) once you boot the UBS image (or without booting it by plugging it into Linux), something like




  1. parted /dev/sdb mkpart primary 3000MiB 100%

  2. mkfs.btrfs /dev/sdb3


By "from scratch" I assume you don't want package selection, to compile or http://www.linuxfromscratch.org/ because that's to long for a unix.stackexchange.com answer.



By "command line only" I assume you don't want "Ubuntu Server"






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    Last I used MacOS I had macports so the following example may require slight adjustment to work on a fresh MacOS install, also read the man pages and be careful not to wipe your system.




    1. wget http://mirror.csclub.uwaterloo.ca/ubuntu-releases/18.04.1/ubuntu-18.04.1-desktop-amd64.iso

    2. sudo -- sh -c 'cat ubuntu-18.04.1-desktop-amd64.iso > /dev/rdisk3 && sync'

    3. boot the Ubuntu live USB via Startup Manager https://support.apple.com/en-us/HT201255

    4. install to a 2nd USB key (or if you don't have one use VirtualBox for #2-3)


    If you really want a Live image (with persistent storage on the side) then you can just use Parted (gParted is the GUI) once you boot the UBS image (or without booting it by plugging it into Linux), something like




    1. parted /dev/sdb mkpart primary 3000MiB 100%

    2. mkfs.btrfs /dev/sdb3


    By "from scratch" I assume you don't want package selection, to compile or http://www.linuxfromscratch.org/ because that's to long for a unix.stackexchange.com answer.



    By "command line only" I assume you don't want "Ubuntu Server"






    share|improve this answer



























      up vote
      0
      down vote













      Last I used MacOS I had macports so the following example may require slight adjustment to work on a fresh MacOS install, also read the man pages and be careful not to wipe your system.




      1. wget http://mirror.csclub.uwaterloo.ca/ubuntu-releases/18.04.1/ubuntu-18.04.1-desktop-amd64.iso

      2. sudo -- sh -c 'cat ubuntu-18.04.1-desktop-amd64.iso > /dev/rdisk3 && sync'

      3. boot the Ubuntu live USB via Startup Manager https://support.apple.com/en-us/HT201255

      4. install to a 2nd USB key (or if you don't have one use VirtualBox for #2-3)


      If you really want a Live image (with persistent storage on the side) then you can just use Parted (gParted is the GUI) once you boot the UBS image (or without booting it by plugging it into Linux), something like




      1. parted /dev/sdb mkpart primary 3000MiB 100%

      2. mkfs.btrfs /dev/sdb3


      By "from scratch" I assume you don't want package selection, to compile or http://www.linuxfromscratch.org/ because that's to long for a unix.stackexchange.com answer.



      By "command line only" I assume you don't want "Ubuntu Server"






      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        Last I used MacOS I had macports so the following example may require slight adjustment to work on a fresh MacOS install, also read the man pages and be careful not to wipe your system.




        1. wget http://mirror.csclub.uwaterloo.ca/ubuntu-releases/18.04.1/ubuntu-18.04.1-desktop-amd64.iso

        2. sudo -- sh -c 'cat ubuntu-18.04.1-desktop-amd64.iso > /dev/rdisk3 && sync'

        3. boot the Ubuntu live USB via Startup Manager https://support.apple.com/en-us/HT201255

        4. install to a 2nd USB key (or if you don't have one use VirtualBox for #2-3)


        If you really want a Live image (with persistent storage on the side) then you can just use Parted (gParted is the GUI) once you boot the UBS image (or without booting it by plugging it into Linux), something like




        1. parted /dev/sdb mkpart primary 3000MiB 100%

        2. mkfs.btrfs /dev/sdb3


        By "from scratch" I assume you don't want package selection, to compile or http://www.linuxfromscratch.org/ because that's to long for a unix.stackexchange.com answer.



        By "command line only" I assume you don't want "Ubuntu Server"






        share|improve this answer














        Last I used MacOS I had macports so the following example may require slight adjustment to work on a fresh MacOS install, also read the man pages and be careful not to wipe your system.




        1. wget http://mirror.csclub.uwaterloo.ca/ubuntu-releases/18.04.1/ubuntu-18.04.1-desktop-amd64.iso

        2. sudo -- sh -c 'cat ubuntu-18.04.1-desktop-amd64.iso > /dev/rdisk3 && sync'

        3. boot the Ubuntu live USB via Startup Manager https://support.apple.com/en-us/HT201255

        4. install to a 2nd USB key (or if you don't have one use VirtualBox for #2-3)


        If you really want a Live image (with persistent storage on the side) then you can just use Parted (gParted is the GUI) once you boot the UBS image (or without booting it by plugging it into Linux), something like




        1. parted /dev/sdb mkpart primary 3000MiB 100%

        2. mkfs.btrfs /dev/sdb3


        By "from scratch" I assume you don't want package selection, to compile or http://www.linuxfromscratch.org/ because that's to long for a unix.stackexchange.com answer.



        By "command line only" I assume you don't want "Ubuntu Server"







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 27 at 2:52

























        answered Nov 27 at 2:44









        user1133275

        2,587415




        2,587415















            Popular posts from this blog

            Accessing regular linux commands in Huawei's Dopra Linux

            Can't connect RFCOMM socket: Host is down

            Kernel panic - not syncing: Fatal Exception in Interrupt