Live CD/USB - run command on start












0















I would like to run some simple commands after system loads, but without editing SquashFS of Ubuntu.



Perfect way would be to have ISO written to USB and just add one simple script on this USB, something like RUN_AFTER_START.sh that would be run after the Ubuntu starts.



Is there any way to do it?










share|improve this question

























  • Why do you not want to edit the SquashFS? What's your reason for using a live CD rather than installing Ubuntu? What's your reason for using a CD rather than a USB media? Is it a usable option for you to use GRUB and modify the GRUB configuration?

    – kasperd
    Jan 12 at 16:44











  • Why is this question tagged 16.10? Ubuntu 16.10 has been out of support for more than a year.

    – kasperd
    Jan 12 at 16:46











  • I meant 18.10 - fixed.

    – Mr. P
    Jan 12 at 16:59











  • @kasperd, I meant LiveUsb - fixed. About why not messing around SquashFS - it is pointless to extract squashfs, change one bit and compress it just to make one simple change. LiveUSB and not installation - i just cannot install ubuntu. I can only use it as LiveUSB. About GRUB - I am not sure if grub will allow me to use Ubuntu apps like apt etc?

    – Mr. P
    Jan 12 at 17:07











  • Why can't you install Ubuntu? It is possible to install Ubuntu on a USB media and run it from there. It is even possible to boot the live system from a USB media and then install Ubuntu on the media you just booted from. As far as I recall the live USB medias do use GRUB as the boot loader, so you could edit the GRUB menu to change how it boots.

    – kasperd
    Jan 12 at 17:17
















0















I would like to run some simple commands after system loads, but without editing SquashFS of Ubuntu.



Perfect way would be to have ISO written to USB and just add one simple script on this USB, something like RUN_AFTER_START.sh that would be run after the Ubuntu starts.



Is there any way to do it?










share|improve this question

























  • Why do you not want to edit the SquashFS? What's your reason for using a live CD rather than installing Ubuntu? What's your reason for using a CD rather than a USB media? Is it a usable option for you to use GRUB and modify the GRUB configuration?

    – kasperd
    Jan 12 at 16:44











  • Why is this question tagged 16.10? Ubuntu 16.10 has been out of support for more than a year.

    – kasperd
    Jan 12 at 16:46











  • I meant 18.10 - fixed.

    – Mr. P
    Jan 12 at 16:59











  • @kasperd, I meant LiveUsb - fixed. About why not messing around SquashFS - it is pointless to extract squashfs, change one bit and compress it just to make one simple change. LiveUSB and not installation - i just cannot install ubuntu. I can only use it as LiveUSB. About GRUB - I am not sure if grub will allow me to use Ubuntu apps like apt etc?

    – Mr. P
    Jan 12 at 17:07











  • Why can't you install Ubuntu? It is possible to install Ubuntu on a USB media and run it from there. It is even possible to boot the live system from a USB media and then install Ubuntu on the media you just booted from. As far as I recall the live USB medias do use GRUB as the boot loader, so you could edit the GRUB menu to change how it boots.

    – kasperd
    Jan 12 at 17:17














0












0








0








I would like to run some simple commands after system loads, but without editing SquashFS of Ubuntu.



Perfect way would be to have ISO written to USB and just add one simple script on this USB, something like RUN_AFTER_START.sh that would be run after the Ubuntu starts.



Is there any way to do it?










share|improve this question
















I would like to run some simple commands after system loads, but without editing SquashFS of Ubuntu.



Perfect way would be to have ISO written to USB and just add one simple script on this USB, something like RUN_AFTER_START.sh that would be run after the Ubuntu starts.



Is there any way to do it?







18.10






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 12 at 17:07







Mr. P

















asked Jan 12 at 16:35









Mr. PMr. P

1314




1314













  • Why do you not want to edit the SquashFS? What's your reason for using a live CD rather than installing Ubuntu? What's your reason for using a CD rather than a USB media? Is it a usable option for you to use GRUB and modify the GRUB configuration?

    – kasperd
    Jan 12 at 16:44











  • Why is this question tagged 16.10? Ubuntu 16.10 has been out of support for more than a year.

    – kasperd
    Jan 12 at 16:46











  • I meant 18.10 - fixed.

    – Mr. P
    Jan 12 at 16:59











  • @kasperd, I meant LiveUsb - fixed. About why not messing around SquashFS - it is pointless to extract squashfs, change one bit and compress it just to make one simple change. LiveUSB and not installation - i just cannot install ubuntu. I can only use it as LiveUSB. About GRUB - I am not sure if grub will allow me to use Ubuntu apps like apt etc?

    – Mr. P
    Jan 12 at 17:07











  • Why can't you install Ubuntu? It is possible to install Ubuntu on a USB media and run it from there. It is even possible to boot the live system from a USB media and then install Ubuntu on the media you just booted from. As far as I recall the live USB medias do use GRUB as the boot loader, so you could edit the GRUB menu to change how it boots.

    – kasperd
    Jan 12 at 17:17



















  • Why do you not want to edit the SquashFS? What's your reason for using a live CD rather than installing Ubuntu? What's your reason for using a CD rather than a USB media? Is it a usable option for you to use GRUB and modify the GRUB configuration?

    – kasperd
    Jan 12 at 16:44











  • Why is this question tagged 16.10? Ubuntu 16.10 has been out of support for more than a year.

    – kasperd
    Jan 12 at 16:46











  • I meant 18.10 - fixed.

    – Mr. P
    Jan 12 at 16:59











  • @kasperd, I meant LiveUsb - fixed. About why not messing around SquashFS - it is pointless to extract squashfs, change one bit and compress it just to make one simple change. LiveUSB and not installation - i just cannot install ubuntu. I can only use it as LiveUSB. About GRUB - I am not sure if grub will allow me to use Ubuntu apps like apt etc?

    – Mr. P
    Jan 12 at 17:07











  • Why can't you install Ubuntu? It is possible to install Ubuntu on a USB media and run it from there. It is even possible to boot the live system from a USB media and then install Ubuntu on the media you just booted from. As far as I recall the live USB medias do use GRUB as the boot loader, so you could edit the GRUB menu to change how it boots.

    – kasperd
    Jan 12 at 17:17

















Why do you not want to edit the SquashFS? What's your reason for using a live CD rather than installing Ubuntu? What's your reason for using a CD rather than a USB media? Is it a usable option for you to use GRUB and modify the GRUB configuration?

– kasperd
Jan 12 at 16:44





Why do you not want to edit the SquashFS? What's your reason for using a live CD rather than installing Ubuntu? What's your reason for using a CD rather than a USB media? Is it a usable option for you to use GRUB and modify the GRUB configuration?

– kasperd
Jan 12 at 16:44













Why is this question tagged 16.10? Ubuntu 16.10 has been out of support for more than a year.

– kasperd
Jan 12 at 16:46





Why is this question tagged 16.10? Ubuntu 16.10 has been out of support for more than a year.

– kasperd
Jan 12 at 16:46













I meant 18.10 - fixed.

– Mr. P
Jan 12 at 16:59





I meant 18.10 - fixed.

– Mr. P
Jan 12 at 16:59













@kasperd, I meant LiveUsb - fixed. About why not messing around SquashFS - it is pointless to extract squashfs, change one bit and compress it just to make one simple change. LiveUSB and not installation - i just cannot install ubuntu. I can only use it as LiveUSB. About GRUB - I am not sure if grub will allow me to use Ubuntu apps like apt etc?

– Mr. P
Jan 12 at 17:07





@kasperd, I meant LiveUsb - fixed. About why not messing around SquashFS - it is pointless to extract squashfs, change one bit and compress it just to make one simple change. LiveUSB and not installation - i just cannot install ubuntu. I can only use it as LiveUSB. About GRUB - I am not sure if grub will allow me to use Ubuntu apps like apt etc?

– Mr. P
Jan 12 at 17:07













Why can't you install Ubuntu? It is possible to install Ubuntu on a USB media and run it from there. It is even possible to boot the live system from a USB media and then install Ubuntu on the media you just booted from. As far as I recall the live USB medias do use GRUB as the boot loader, so you could edit the GRUB menu to change how it boots.

– kasperd
Jan 12 at 17:17





Why can't you install Ubuntu? It is possible to install Ubuntu on a USB media and run it from there. It is even possible to boot the live system from a USB media and then install Ubuntu on the media you just booted from. As far as I recall the live USB medias do use GRUB as the boot loader, so you could edit the GRUB menu to change how it boots.

– kasperd
Jan 12 at 17:17










1 Answer
1






active

oldest

votes


















1














You can make a persistent live drive. I suggest Ubuntu 18.04.1 LTS, using mkusb





  • If you run standard Ubuntu live, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)



    sudo add-apt-repository universe  # only for standard Ubuntu

    sudo add-apt-repository ppa:mkusb/ppa # and press Enter
    sudo apt-get update

    sudo apt-get install mkusb mkusb-nox usb-pack-efi



  • Run mkusb-dus in order to create the persistent live drive



     dus ubuntu-18.04.1-desktop-amd64.iso



Boot into the persistent live drive





  • Activate the repository 'universe' (good for many application programs, including espeak that I use for a demo example)



    sudo add-apt-repository universe
    sudo apt update
    sudo apt install espeak



  • Edit crontab: Select the simple editor nano



    crontab -e


    and add the line (you need full path to the command)



    @reboot                 /usr/bin/espeak 'I am ready now'


    exit and save.



  • Reboot and you should hear the computer say 'I am ready now' just before you will see the desktop.





If you want to run a desktop application program I suggest that you use autostart, add a desktop file into the directory



/etc/xdg/autostart





share|improve this answer


























  • @reboot runs quite early during boot. Depending on what command you want to run it's quite possible the services it depends on haven't started yet.

    – kasperd
    Jan 12 at 20:02











  • @kasperd, you are right. And if that is the case for our OP, we may have to work out more details about autostart (even if it is not a desktop application program, or should I say a program with a graphical user interface).

    – sudodus
    Jan 12 at 21:30











  • Thanks guys for help. I have used the easiest (i think :) ) approach - persistence. I got, however, multiple problems with mkusb but it was probably with wrong selection of items (GPT, MSDOS, uefi and so on...). Anyway, in the end I managed to get it working. Currently i have 1 question: With 'persistent' and 'toram' options in grub, is the persistence overlay loaded to RAM as well or only linux image is loaded to ram and the rest is on usb?

    – Mr. P
    yesterday













  • When running (and when there is enough RAM), things that are used are in RAM. ToRAM makes the squash file system load into RAM at boot (instead of loading things, when needed). Normally the partition with the image of the iso file, /dev/sdb4, is mounted on /cdrom, but with toram /dev/shm is mounted on /cdrom as you can see with the command df. But the casper-rw partition is still mounted, this is where things are stored (maybe not directly, it is probably buffered in RAM, but you cannot disconnect the persistent live USB drive).

    – sudodus
    yesterday











  • On the other hand, in a live-only system (booted without persistence), when you boot with toram, the running system is completely detached from the USB drive, so after unmounting other (non-system) partitions you can unplug it.

    – sudodus
    yesterday











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109165%2flive-cd-usb-run-command-on-start%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You can make a persistent live drive. I suggest Ubuntu 18.04.1 LTS, using mkusb





  • If you run standard Ubuntu live, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)



    sudo add-apt-repository universe  # only for standard Ubuntu

    sudo add-apt-repository ppa:mkusb/ppa # and press Enter
    sudo apt-get update

    sudo apt-get install mkusb mkusb-nox usb-pack-efi



  • Run mkusb-dus in order to create the persistent live drive



     dus ubuntu-18.04.1-desktop-amd64.iso



Boot into the persistent live drive





  • Activate the repository 'universe' (good for many application programs, including espeak that I use for a demo example)



    sudo add-apt-repository universe
    sudo apt update
    sudo apt install espeak



  • Edit crontab: Select the simple editor nano



    crontab -e


    and add the line (you need full path to the command)



    @reboot                 /usr/bin/espeak 'I am ready now'


    exit and save.



  • Reboot and you should hear the computer say 'I am ready now' just before you will see the desktop.





If you want to run a desktop application program I suggest that you use autostart, add a desktop file into the directory



/etc/xdg/autostart





share|improve this answer


























  • @reboot runs quite early during boot. Depending on what command you want to run it's quite possible the services it depends on haven't started yet.

    – kasperd
    Jan 12 at 20:02











  • @kasperd, you are right. And if that is the case for our OP, we may have to work out more details about autostart (even if it is not a desktop application program, or should I say a program with a graphical user interface).

    – sudodus
    Jan 12 at 21:30











  • Thanks guys for help. I have used the easiest (i think :) ) approach - persistence. I got, however, multiple problems with mkusb but it was probably with wrong selection of items (GPT, MSDOS, uefi and so on...). Anyway, in the end I managed to get it working. Currently i have 1 question: With 'persistent' and 'toram' options in grub, is the persistence overlay loaded to RAM as well or only linux image is loaded to ram and the rest is on usb?

    – Mr. P
    yesterday













  • When running (and when there is enough RAM), things that are used are in RAM. ToRAM makes the squash file system load into RAM at boot (instead of loading things, when needed). Normally the partition with the image of the iso file, /dev/sdb4, is mounted on /cdrom, but with toram /dev/shm is mounted on /cdrom as you can see with the command df. But the casper-rw partition is still mounted, this is where things are stored (maybe not directly, it is probably buffered in RAM, but you cannot disconnect the persistent live USB drive).

    – sudodus
    yesterday











  • On the other hand, in a live-only system (booted without persistence), when you boot with toram, the running system is completely detached from the USB drive, so after unmounting other (non-system) partitions you can unplug it.

    – sudodus
    yesterday
















1














You can make a persistent live drive. I suggest Ubuntu 18.04.1 LTS, using mkusb





  • If you run standard Ubuntu live, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)



    sudo add-apt-repository universe  # only for standard Ubuntu

    sudo add-apt-repository ppa:mkusb/ppa # and press Enter
    sudo apt-get update

    sudo apt-get install mkusb mkusb-nox usb-pack-efi



  • Run mkusb-dus in order to create the persistent live drive



     dus ubuntu-18.04.1-desktop-amd64.iso



Boot into the persistent live drive





  • Activate the repository 'universe' (good for many application programs, including espeak that I use for a demo example)



    sudo add-apt-repository universe
    sudo apt update
    sudo apt install espeak



  • Edit crontab: Select the simple editor nano



    crontab -e


    and add the line (you need full path to the command)



    @reboot                 /usr/bin/espeak 'I am ready now'


    exit and save.



  • Reboot and you should hear the computer say 'I am ready now' just before you will see the desktop.





If you want to run a desktop application program I suggest that you use autostart, add a desktop file into the directory



/etc/xdg/autostart





share|improve this answer


























  • @reboot runs quite early during boot. Depending on what command you want to run it's quite possible the services it depends on haven't started yet.

    – kasperd
    Jan 12 at 20:02











  • @kasperd, you are right. And if that is the case for our OP, we may have to work out more details about autostart (even if it is not a desktop application program, or should I say a program with a graphical user interface).

    – sudodus
    Jan 12 at 21:30











  • Thanks guys for help. I have used the easiest (i think :) ) approach - persistence. I got, however, multiple problems with mkusb but it was probably with wrong selection of items (GPT, MSDOS, uefi and so on...). Anyway, in the end I managed to get it working. Currently i have 1 question: With 'persistent' and 'toram' options in grub, is the persistence overlay loaded to RAM as well or only linux image is loaded to ram and the rest is on usb?

    – Mr. P
    yesterday













  • When running (and when there is enough RAM), things that are used are in RAM. ToRAM makes the squash file system load into RAM at boot (instead of loading things, when needed). Normally the partition with the image of the iso file, /dev/sdb4, is mounted on /cdrom, but with toram /dev/shm is mounted on /cdrom as you can see with the command df. But the casper-rw partition is still mounted, this is where things are stored (maybe not directly, it is probably buffered in RAM, but you cannot disconnect the persistent live USB drive).

    – sudodus
    yesterday











  • On the other hand, in a live-only system (booted without persistence), when you boot with toram, the running system is completely detached from the USB drive, so after unmounting other (non-system) partitions you can unplug it.

    – sudodus
    yesterday














1












1








1







You can make a persistent live drive. I suggest Ubuntu 18.04.1 LTS, using mkusb





  • If you run standard Ubuntu live, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)



    sudo add-apt-repository universe  # only for standard Ubuntu

    sudo add-apt-repository ppa:mkusb/ppa # and press Enter
    sudo apt-get update

    sudo apt-get install mkusb mkusb-nox usb-pack-efi



  • Run mkusb-dus in order to create the persistent live drive



     dus ubuntu-18.04.1-desktop-amd64.iso



Boot into the persistent live drive





  • Activate the repository 'universe' (good for many application programs, including espeak that I use for a demo example)



    sudo add-apt-repository universe
    sudo apt update
    sudo apt install espeak



  • Edit crontab: Select the simple editor nano



    crontab -e


    and add the line (you need full path to the command)



    @reboot                 /usr/bin/espeak 'I am ready now'


    exit and save.



  • Reboot and you should hear the computer say 'I am ready now' just before you will see the desktop.





If you want to run a desktop application program I suggest that you use autostart, add a desktop file into the directory



/etc/xdg/autostart





share|improve this answer















You can make a persistent live drive. I suggest Ubuntu 18.04.1 LTS, using mkusb





  • If you run standard Ubuntu live, you need an extra instruction to get the repository Universe. (Kubuntu, Lubuntu ... Xubuntu have the repository Universe activated automatically.)



    sudo add-apt-repository universe  # only for standard Ubuntu

    sudo add-apt-repository ppa:mkusb/ppa # and press Enter
    sudo apt-get update

    sudo apt-get install mkusb mkusb-nox usb-pack-efi



  • Run mkusb-dus in order to create the persistent live drive



     dus ubuntu-18.04.1-desktop-amd64.iso



Boot into the persistent live drive





  • Activate the repository 'universe' (good for many application programs, including espeak that I use for a demo example)



    sudo add-apt-repository universe
    sudo apt update
    sudo apt install espeak



  • Edit crontab: Select the simple editor nano



    crontab -e


    and add the line (you need full path to the command)



    @reboot                 /usr/bin/espeak 'I am ready now'


    exit and save.



  • Reboot and you should hear the computer say 'I am ready now' just before you will see the desktop.





If you want to run a desktop application program I suggest that you use autostart, add a desktop file into the directory



/etc/xdg/autostart






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 12 at 19:35

























answered Jan 12 at 19:29









sudodussudodus

23.3k32874




23.3k32874













  • @reboot runs quite early during boot. Depending on what command you want to run it's quite possible the services it depends on haven't started yet.

    – kasperd
    Jan 12 at 20:02











  • @kasperd, you are right. And if that is the case for our OP, we may have to work out more details about autostart (even if it is not a desktop application program, or should I say a program with a graphical user interface).

    – sudodus
    Jan 12 at 21:30











  • Thanks guys for help. I have used the easiest (i think :) ) approach - persistence. I got, however, multiple problems with mkusb but it was probably with wrong selection of items (GPT, MSDOS, uefi and so on...). Anyway, in the end I managed to get it working. Currently i have 1 question: With 'persistent' and 'toram' options in grub, is the persistence overlay loaded to RAM as well or only linux image is loaded to ram and the rest is on usb?

    – Mr. P
    yesterday













  • When running (and when there is enough RAM), things that are used are in RAM. ToRAM makes the squash file system load into RAM at boot (instead of loading things, when needed). Normally the partition with the image of the iso file, /dev/sdb4, is mounted on /cdrom, but with toram /dev/shm is mounted on /cdrom as you can see with the command df. But the casper-rw partition is still mounted, this is where things are stored (maybe not directly, it is probably buffered in RAM, but you cannot disconnect the persistent live USB drive).

    – sudodus
    yesterday











  • On the other hand, in a live-only system (booted without persistence), when you boot with toram, the running system is completely detached from the USB drive, so after unmounting other (non-system) partitions you can unplug it.

    – sudodus
    yesterday



















  • @reboot runs quite early during boot. Depending on what command you want to run it's quite possible the services it depends on haven't started yet.

    – kasperd
    Jan 12 at 20:02











  • @kasperd, you are right. And if that is the case for our OP, we may have to work out more details about autostart (even if it is not a desktop application program, or should I say a program with a graphical user interface).

    – sudodus
    Jan 12 at 21:30











  • Thanks guys for help. I have used the easiest (i think :) ) approach - persistence. I got, however, multiple problems with mkusb but it was probably with wrong selection of items (GPT, MSDOS, uefi and so on...). Anyway, in the end I managed to get it working. Currently i have 1 question: With 'persistent' and 'toram' options in grub, is the persistence overlay loaded to RAM as well or only linux image is loaded to ram and the rest is on usb?

    – Mr. P
    yesterday













  • When running (and when there is enough RAM), things that are used are in RAM. ToRAM makes the squash file system load into RAM at boot (instead of loading things, when needed). Normally the partition with the image of the iso file, /dev/sdb4, is mounted on /cdrom, but with toram /dev/shm is mounted on /cdrom as you can see with the command df. But the casper-rw partition is still mounted, this is where things are stored (maybe not directly, it is probably buffered in RAM, but you cannot disconnect the persistent live USB drive).

    – sudodus
    yesterday











  • On the other hand, in a live-only system (booted without persistence), when you boot with toram, the running system is completely detached from the USB drive, so after unmounting other (non-system) partitions you can unplug it.

    – sudodus
    yesterday

















@reboot runs quite early during boot. Depending on what command you want to run it's quite possible the services it depends on haven't started yet.

– kasperd
Jan 12 at 20:02





@reboot runs quite early during boot. Depending on what command you want to run it's quite possible the services it depends on haven't started yet.

– kasperd
Jan 12 at 20:02













@kasperd, you are right. And if that is the case for our OP, we may have to work out more details about autostart (even if it is not a desktop application program, or should I say a program with a graphical user interface).

– sudodus
Jan 12 at 21:30





@kasperd, you are right. And if that is the case for our OP, we may have to work out more details about autostart (even if it is not a desktop application program, or should I say a program with a graphical user interface).

– sudodus
Jan 12 at 21:30













Thanks guys for help. I have used the easiest (i think :) ) approach - persistence. I got, however, multiple problems with mkusb but it was probably with wrong selection of items (GPT, MSDOS, uefi and so on...). Anyway, in the end I managed to get it working. Currently i have 1 question: With 'persistent' and 'toram' options in grub, is the persistence overlay loaded to RAM as well or only linux image is loaded to ram and the rest is on usb?

– Mr. P
yesterday







Thanks guys for help. I have used the easiest (i think :) ) approach - persistence. I got, however, multiple problems with mkusb but it was probably with wrong selection of items (GPT, MSDOS, uefi and so on...). Anyway, in the end I managed to get it working. Currently i have 1 question: With 'persistent' and 'toram' options in grub, is the persistence overlay loaded to RAM as well or only linux image is loaded to ram and the rest is on usb?

– Mr. P
yesterday















When running (and when there is enough RAM), things that are used are in RAM. ToRAM makes the squash file system load into RAM at boot (instead of loading things, when needed). Normally the partition with the image of the iso file, /dev/sdb4, is mounted on /cdrom, but with toram /dev/shm is mounted on /cdrom as you can see with the command df. But the casper-rw partition is still mounted, this is where things are stored (maybe not directly, it is probably buffered in RAM, but you cannot disconnect the persistent live USB drive).

– sudodus
yesterday





When running (and when there is enough RAM), things that are used are in RAM. ToRAM makes the squash file system load into RAM at boot (instead of loading things, when needed). Normally the partition with the image of the iso file, /dev/sdb4, is mounted on /cdrom, but with toram /dev/shm is mounted on /cdrom as you can see with the command df. But the casper-rw partition is still mounted, this is where things are stored (maybe not directly, it is probably buffered in RAM, but you cannot disconnect the persistent live USB drive).

– sudodus
yesterday













On the other hand, in a live-only system (booted without persistence), when you boot with toram, the running system is completely detached from the USB drive, so after unmounting other (non-system) partitions you can unplug it.

– sudodus
yesterday





On the other hand, in a live-only system (booted without persistence), when you boot with toram, the running system is completely detached from the USB drive, so after unmounting other (non-system) partitions you can unplug it.

– sudodus
yesterday


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109165%2flive-cd-usb-run-command-on-start%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局