I recently purchased an external USB hard drive and wanted to use it as a portable boot drive. I installed Linux Mint 18.1 on it and got everything working.
Then I started to think about using that drive to install Linux on other machines. I assumed that whatever a live boot USB does should be possible from a full-blown Linux installation. I looked around and the only option I found was from Ubuntu: Installation/From Linux. Their solution is to create a partition, fill it with the ISO contents and then boot from that to launch the installer.
I did follow those instructions and got it working as expected, however, I still feel there must be a way to install Linux from Linux without booting into an ISO.
I just found a related question: Installing without booting. There is an answer there that suggests there is some sequence of operations that could be run to install Linux on another partition, but I would need more detail than provided there. Is that process documented somewhere?
Honestly, I would be more comfortable if I could just run the installers that are included in the live boot images of each distro. Or some kind of semi-authoritative script that would do the same thing. Is there a package in the repos that would provide such a thing (eg. a Linux Mint installer package that could be installed using apt-get
or yum
)?
Best Answer
There is an example to install debian from a Linux-mint live USB (or any debian based distro). If you have a debian based distribution already installed on your hdd , you can install other debian based distro using
chroot
anddebootstrap
from the existing OS.Boot from the live USB .Use gparted to create your
root
,swap
,/home
... partitions.If you prefer the command line (
fdisk
, parted ..) , there is how to activate the swap partition :Let's say you need to install debian stretch .
Install the
debootstrap
package :Create the
/mnt/stable
then mount your root partition (sdaX
)Install the base system:
Set up your root password:
Add a new user:
Set up the hostname :
Configure the
/etc/fstab
:add the following lines:
use the debian documentation to edit your
sources.list
(replacejessie
bystretch
)Configure locale :
Configure you keyboard:
Install the kernel:
Then:
Configure the network:
and past the following:
To manage the wifi network install the following packages:
Install grub :
You can install a desktop environment through the command
tasksel
:Run the following command and install your favorite GUI:
Finally exit the chroot and reboot your system
Documentation: D.3. Installing Debian GNU/Linux from a Unix/Linux System
Debian wiki: