You are not logged in.

#1 2013-02-09 23:23:19

smsware
Member
From: Szczecin, Poland
Registered: 2012-08-14
Posts: 149
Website

[SOLVED] Two Arch installations with single boot partition

This may be a silly question but when I'm trying to install 32-bit Arch from within 64-bit Arch, it stands:

error: failed to commit transaction (conflicting files)
linux: /opt/Arch32/boot/vmlinuz-linux exists in filesystem
Errors occurred, no packages were upgraded.

Obviouslly. But boot partition can be shared, right? So what to do?

My fstab of current system (fstab of target system would be the opposite (/opt/Arch64)):

# /dev/sda3
UUID=51195204-af10-4457-a6d4-ad5c1b38e1af	/         	ext4      	defaults,relatime	0 1

# /dev/sda2
UUID=c635228e-a0a5-47a3-9542-92e196af6d9e	/boot     	ext4      	defaults,relatime	0 2

# /dev/sda1
UUID=7FD5-E047      				/boot/efi 	vfat      	noatime	0 2

# /dev/sda6
UUID=bb554d26-f6d7-44ad-8a97-fedf9b61d0c2	/home     	ext4      	defaults,relatime	0 2

# /dev/sda4
UUID=77a82479-0ec6-481b-a0e0-49a610fd5089	/opt/Arch32	ext4      	defaults,relatime	0 2

# /dev/sda2
UUID=c635228e-a0a5-47a3-9542-92e196af6d9e	/opt/Arch32/boot	ext4      	defaults,relatime	0 2

# /dev/sda1
UUID=7FD5-E047      				/opt/Arch32/boot/efi	vfat      	noatime	0 2

# /dev/sda7
UUID=aec92ee8-2464-41b7-9b88-c460b86083a8	/opt/Arch32/home	ext4      	defaults,relatime	0 2

# /dev/sda5
UUID=cfb92c59-dc94-4961-9110-79bdbc18eaf3	none      	swap      	defaults  	0 0

My point is that I want to have the possiblity to both run any of the systems from grub level and to chroot any of it from within the other. I don't need another bootloader and care about UEFI/GPT, right?

Last edited by smsware (2013-02-11 02:26:30)

Offline

#2 2013-02-10 00:02:08

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [SOLVED] Two Arch installations with single boot partition

Sorry. So you are mounting partitions simultaneously in multiple places? Is that wise?

You might look at /etc/mkinitcpio.d/example.preset but I don't think this is going to work as you want.

Boot partition can be shared but you are trying to install identically named initramfs and kernels to /boot.

Last edited by cfr (2013-02-10 00:03:13)


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#3 2013-02-10 02:57:30

smsware
Member
From: Szczecin, Poland
Registered: 2012-08-14
Posts: 149
Website

Re: [SOLVED] Two Arch installations with single boot partition

cfr wrote:

Sorry. So you are mounting partitions simultaneously in multiple places? Is that wise?

Why isn't it? It's kind like linking, right? Then you have acces to the same place from within differend locations, it's common. But I may be wrong, I'm not really an expert. Chroot is working on multi-mounted home and swap so boot partition shoudn't be an exeption.

You might look at /etc/mkinitcpio.d/example.preset but I don't think this is going to work as you want.

If it's not gonna work as I want - why would I look at it? ;-)
But I believe it will... I can change the name there... but after every update - I would have to manually change the names and care about it... and I don't like that - that's why I'm using GRUB2 instead of booting kernel from UEFI directly.

Boot partition can be shared but you are trying to install identically named initramfs and kernels to /boot.

And that's the case - how can I change the name (vmlinuz-linux32 and vmlinuz-linux64) or location (like /boot/arch32/vmlinuz... and /boot/arch64/vmlinuz...)? I could just install different kernel, right? Like linux-lts for example... it would be named differently and there would be no problem - so there should be some work-around to rename the original one. I will install some patched version if I won't find any other solution - but I believe it's kinda overdo as I don't really need it and don't wanna use LTS versions as I enjoy cutting-edge solutions (and that's why I'm Arch user) and patched versions are installed by AUR so they nned to be cared manually too.

Let's forgot I want to chroot into one system from another (step-by-step approach)... how can I just have two exact installations of Arch with single boot?

Last edited by smsware (2013-02-10 03:05:50)

Offline

#4 2013-02-10 04:11:28

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: [SOLVED] Two Arch installations with single boot partition

smsware wrote:

You might look at /etc/mkinitcpio.d/example.preset but I don't think this is going to work as you want.

If it's not gonna work as I want - why would I look at it? ;-)

I didn't say it wouldn't work. I said I didn't think it would work as you want. So there are at least 2 reasons to investigate. First, I could well think wrong. Second, it might work in a way you don't currently want but don't currently not want either. You might just not have considered it.

You wouldn't need to rename them by hand - you can set up a service to do that the same way you can if you're using the EFI stub loader. You could always use rEFInd and then you could put one lot on the EFI partition and one lot on /boot or stick them in different directories of the EFI partition or whatever. I guess you could keep them on /boot, too. Not sure with grub. At least, not sure how you would do it using mkconfig.

About fstab. I think you should be using the bind option to do this. See the  manual page for mount. It seems designed to do just what you want.

Last edited by cfr (2013-02-10 04:20:57)


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#5 2013-02-10 04:54:03

smsware
Member
From: Szczecin, Poland
Registered: 2012-08-14
Posts: 149
Website

Re: [SOLVED] Two Arch installations with single boot partition

Yeah, I read the link you posted me.

Will need to learn about these services, it's new thing to me, this whole systemctl; I'm back to Arch after a year and everything's different. :-)

Offline

#6 2013-02-10 05:43:42

Hydranix
Member
Registered: 2013-02-10
Posts: 36

Re: [SOLVED] Two Arch installations with single boot partition

It's actually not that hard to do.

The quick dirty way to do it would be to simply:

Rename your kernel and initramfs to anything but the default.

Edit the file /boot/grub/grub.cfg

In the entry either auto generated, or that you made, point to the new renamed kernel and initramfs instead of the default.


Once you've done that, if all other settings were correctly configured during install, you should boot without problems.

Offline

#7 2013-02-10 13:32:35

smsware
Member
From: Szczecin, Poland
Registered: 2012-08-14
Posts: 149
Website

Re: [SOLVED] Two Arch installations with single boot partition

Hydranix wrote:

Once you've done that, if all other settings were correctly configured during install, you should boot without problems.

I believe so but after a kernel upgrade (on Arch I see they are quite often) I will have to manually replace the files again and again...

PATH:

[Unit]
Description=Arch64 kernel renamer

[Path]
PathChanged=/boot/vmlinuz-linux
PathChanged=/boot/initramfs-linux.img
PathChanged=/boot/initramfs-linux-fallback.img

[Install]
WantedBy=multi-user.target

SERVICE:

[Unit]
Description=Arch64 kernel renamer

[Service]
Type=oneshot
ExecStart=/bin/cp -f /boot/vmlinuz-linux /boot/vmlinuz-linux64
ExecStart=/bin/cp -f /boot/initramfs-linux.img /boot/initramfs-linux64.img
ExecStart=/bin/cp -f /boot/initramfs-linux-fallback.img /boot/initramfs-linux64-fallback.img

Will these do? For Arch32, the same but "linux32". I'm worrying these two won't cooperate well (e.g. it will copy 32-bit kernel, not 64-bit, just because... something changed, unplanned).

Edit: after changing the /etc/mkinitcpio.d/linux.preset and upgrading linux with pacman, everything seems fine:

(1/1) upgrading linux                              [######################] 100%
>>> Updating module dependencies. Please wait ...
>>> Generating initial ramdisk, using mkinitcpio.  Please wait...
==> Building image from preset: 'default'
  -> -k /boot/vmlinuz-linux64 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux64.img
==> Starting build: 3.7.6-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip initcpio image: /boot/initramfs-linux64.img
==> Image generation successful
==> Building image from preset: 'fallback'
  -> -k /boot/vmlinuz-linux64 -c /etc/mkinitcpio.conf -g /boot/initramfs-linux64-fallback.img -S autodetect
==> Starting build: 3.7.6-1-ARCH
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip initcpio image: /boot/initramfs-linux64-fallback.img
==> Image generation successful

But deleted vmlinuz-linux file is recreated so I don't know what is pacman doing... vmlinuz-linux and vmlinuz-linux64 has the same timestamp after that. I don't have linux older version in /var/cache/pacman/pkg so I can't do an experiment to see which is witch after upgrading.

Last edited by smsware (2013-02-10 14:08:08)

Offline

#8 2013-02-11 02:25:53

smsware
Member
From: Szczecin, Poland
Registered: 2012-08-14
Posts: 149
Website

Re: [SOLVED] Two Arch installations with single boot partition

I just used linux-ck on my main system and everythig's okay. The idea of changing names was working too and wasn't even that bad - I've made service deleting vmlinuz-linux after upgrading the kernel so I was always sure which one is which. But after learned about linux-ck I thought it's good to have it and it's totally not needed in my second system so problem is solved anyway. :-)

Offline

Board footer

Powered by FluxBB