PDA

View Full Version : [SOLVED] Installing second Fedora from an existing Fedora



tomonacci
15th September 2017, 05:44 PM
When you already have a running copy of Fedora (installed in a disk partition, in my case F26 Workstation x86_64), how do you use anaconda to install Fedora on another drive/partition? Just running sudo anaconda from the terminal didn't work (it crashes at some point). I want to avoid downloading the live installer image and copying it to CD/USB etc.

dswaner
15th September 2017, 06:07 PM
As far as I know, there isn't any way to install without an install iso / LiveCD. If you still have the iso / LiveCD from when you did the install for your running system, you could use that.

You also may want to check out this thread: Install a second Fedora on UEFI system on the same disk (https://forums.fedoraforum.org/showthread.php?t=312443)

dd_wizard
15th September 2017, 07:37 PM
You can use
dnf --installroot=PathToPartion group install "Some Desktop Group"
to install a new desktop in another partition. Grub won't be installed, but that shouldn't matter since it's already installed for your primary partition. I followed this arch linux guide (https://wiki.archlinux.org/index.php/Installation_guide) for setting up the partition, mounting it, and bind mounting the tempfs file systems. Drill down until you find the section that shows bind mounting all the tmpfs file systems, or clean up the unnecessary directories after the install. I've done this on USB thumb drives and SDD partitions successfully. Just go slow and make sure you understand the guide before you start. I don't know if this is possible with Anaconda.

dd_wizard

srakitnican
15th September 2017, 10:00 PM
In addition to grub, kernel wont be installed either, although it is not necessary for chroot and container environment you wont be able to boot physical machine without one.

dd_wizard
15th September 2017, 11:01 PM
If I recall correctly, the kernel is installed, but you do need to run dracut in the chroot before you can boot the new install. I'm trying to find my notes, because that took a while to figure out. Also, you need to create /etc/fstab and some other odds and ends. But they're described in the arch wiki.

dd_wizard

flyingdutchman
16th September 2017, 04:45 AM
Kickstart is the answer.

tomonacci
17th September 2017, 05:29 AM
Thanks for all the input. I am currently experimenting on using dnf as suggested by dd_wizard and it seems to work.

dswaner: Yeah the USB I used for installation has already been repurposed... Thanks for the pointer. At the moment all my Fedoras are of the same version so the problem described there hasn't been affecting me too much (besides I couldn't use the installer).

dd_wizard: Thanks for the tip. Regarding srakitnican's comment, some desktop groups don't pull in the kernel as a dependency but you can always directly issue `dnf install kernel` so this caused no problem. By the way if you could share your notes that would be great.

flyingdutchman: I thought Kickstart is for automating the installation process. I actually wanted to use the GUI interactive installer in the Live CD except that I didn't want to burn one ;-p

tomonacci
17th September 2017, 11:05 PM
I was able to successfully install a new desktop by following the "dnf method". For the record I'll post the steps I took:



# 0. Temporarily disable selinux (it sometimes gets in the way during the later steps).
setenforce 0

# 1. Mount the new root partition (/dev/sda6, for example).
mount /dev/sda6 /mnt/another

# 2. Make /etc/fstab and /etc/hostname for the new desktop.
# When writing /etc/fstab, make sure /boot/efi is pointing to the right EFI partition,
# especially when the current and new root partitions are not in the same drive.
mkdir /mnt/another/etc
vi /mnt/another/etc/fstab
echo 'another.localdomain' > /mnt/another/etc/hostname

# 3. Depending on what you wrote in the /etc/fstab file,
# mount the EFI partition (/dev/sda1 for example) at /boot/efi relative to the new root.
mkdir -p /mnt/another/boot/efi
mount /dev/sda1 /mnt/another/boot/efi

# 4. Install packages as needed. It is important to install all the drivers you need.
# You'll see a few errors related to the bus not being up, there being no /dev/null etc. but I think you can ignore them.
dnf --installroot=/mnt/another --releasever=26 group install Core base-x 'Hardware Support' 'GNOME Desktop Environment'
dnf --installroot=/mnt/another --releasever=26 install kernel-modules-extra # for added drivers support

# 5. Set root password for the new system.
chroot /mnt/another
passwd # set the password
exit # from chroot

# 6. Update the grub entries.
# Hopefully the new installation will be discovered by the prober and grub will automatically create an entry for the new installation.
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

# 7. Restart the machine and boot into the new installation.
# In grub, edit the kernel boot line and add selinux=0 to disable selinux.
# If everything goes well, you will enter a GUI session that walks you through choosing the language, setting up your account etc.
# If not, you will have to troubleshoot by possibly logging in as a root (using the password we set at step 5).
# If you find out that you need more packages but are without the network,
# you can boot the old desktop and use the --installroot option again.

# 8. Re-enable selinux.
# Reboot into the new installation, this time adding enforcing=0 autorelabel.


A reference on enabling/disabling selinux: https://www.crypt.gen.nz/papers/how-to-disable-selinux/
One minor problem my new installation has is that there is no splash screen during booting and shutdown but I don't really need them so that's okay : )