I want to install Debian directly onto my USB drive. Is there an easy way to do this directly without having to reboot to run the installer?

  • Pogogunner@sopuli.xyz
    link
    fedilink
    arrow-up
    11
    ·
    2 months ago

    I installed from one flash drive with the image (on ventoy) to another flash drive that was plugged in to be the boot drive. On a cheap USB2 drive, it’s unusably slow - so make sure you use the fastest drive you can

    • thanks_shakey_snake@lemmy.ca
      link
      fedilink
      arrow-up
      4
      ·
      2 months ago

      +1 for “it’s unusably slow!”

      I tried this last year with Linux Mint, and I learned that a normal USB drive just doesn’t have the read/write speed to even e.g. operate Firefox smoothly. There are different ways to address that, none of which really did the trick for me, so the best bet is to just get a drive with the fastest read/write rate possible. I’ve heard that it can run tolerably well on one of those more performant drives, but I didn’t try it myself.

    • bjornsno@lemm.ee
      link
      fedilink
      arrow-up
      4
      ·
      2 months ago

      This doesn’t really install it, though, you can’t update or permanently edit and config, set up users, or anything like that. I would guess OP wants something more like booting the ISO in a VM, allocating a thumb drive to that VM, and then installing a full system to it with a boot loader.

  • sic_semper_tyrannis@lemmy.today
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    2 months ago

    I used to have a SanDisk Extreme Portable running Ubuntu. If it was unplugged, my computer would boot Windows and when I plugged in the SSD to USB it would auto boot into Ubuntu. I have no idea how I did it though. It was my first time using Linux and I followed a guide online.

    Edit: found the video

  • taaz@biglemmowski.win
    link
    fedilink
    English
    arrow-up
    9
    ·
    edit-2
    2 months ago

    So the lower-ish difficulty answer would be to run the iso installer in a VM with the usb stick forwarded to that VM.

    Or you can learn what those fancy installers do: on debian you would use debootstrap

    Here seems the whole guide on how to install debian manually with it:
    https://gist.github.com/tr3buchet/6407920

    Btw, this is also basically how you install Arch. As of until recently there wasn’t any installer and you had to go through each step manually (create partitions and fs, install the base system with <insert distro specific tool>, chroot, update fstab, distro specific finishing touches, voilà)

    • lud@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      2 months ago

      Depending on what OP actually wants to do it might be simpler to just install Linux normally in a VM. I recommend Hyper-v if you are using Windows Pro and if you are using Windows Home I recommend upgrading to Pro using MAS scripts or using a workaround to install Hyper-V on Home.

      You could also use a hypervisor like virtualbox but they are type 2 hypervisors which are usually slower compared to type 1 like Hyper-v or KVM.

  • Kalcifer@sh.itjust.works
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    2 months ago

    without having to reboot to run the installer?

    I’m not sure that I understand what you mean. Are you saying that you want to be able to load the OS without having to reboot your computer? Or are you saying that you just don’t want to have to click the equivalent of “try the OS” when booting a live USB? If it’s the latter, you should be able to just select the flash drive as the install point (though, tbc, I have never tried this, but I don’t see why it wouldn’t work) (I think you’d need 2 USBs, though — you’d need 1 to be the installer source, and one to be the install point — I don’t think theres any installer that can run as a desktop application. Though, if it’s Arch Linux, you might actually be able to call pacstrap from the host OS — I’ve never tried this after having already installed the OS). There’s even OS’s that are specifically designed to be ephemeral on hardware in this way — eg Tails OS.

  • Possibly linux@lemmy.zip
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    Don’t do that

    You can but it will be very slow and your drive will die quickly. Alternatively you could make a USB drive with MX Linux and then only save what you need.

    • tetris11@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      If the system you have has enough RAM you could load the entire OS to RAM and then change the writeback settings to a high interval

        • tetris11@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          dunno, the system might ran out of RAM due to lack of swap, but the drive should be fine due to the limited writes

          • Possibly linux@lemmy.zip
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 months ago

            Well no because the cache will fill up faster than writes that are happening. You would be postponing the inevitable.

            The only option is to either reduce the number if writes by using MX Linux on the USB or to get something that can handle the writes like a USB NVMe enclosure

  • ikidd@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 months ago

    MX Linux and it’s predecessor (can’t recall the original version) is a Debian distro that will run with a persistence cache on a USB stick.