You are not logged in.

#1 2014-10-26 19:58:22

entodoays
Member
From: Malta
Registered: 2014-10-25
Posts: 118

[SOLVED] Transfer Arch installation

I have Arch installed on an external hard disk and it's working fine. Now that I'm happy with my experiment with Arch, I decided to transfer it to my laptop's hard disk where I already have windows 7 and Ubuntu.

I created a new ext4 partition on my main hard disk then followed https://wiki.archlinux.org/index.php/Fu … with_rsync to clone my Arch installation from my external hard disk.

Then I modified fstab accordingly to match the root and swap partitions.

The problem come with booting. Since I already have grub installed on /dev/sda I didn't modify the grub settings in arch. Instead I booted Ubuntu and ran

sudo update-grub

. Surely enough, it found Arch and added it to the Grub menu but I cannot boot Arch.

When I choose Arch in Grub it complains that it cannot find the root partition. How do I solve this issue without reinstalling from scratch?

This is the menu entry in grub.cfg:

menuentry 'Arch Linux, with Linux linux (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--ef08378f-2bf8-4c3f-a2a6-cb2ea3d24cd3' {
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos8'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos8 --hint-efi=hd0,msdos8 --hint-baremetal=ahci0,msdos8  ef08378f-2bf8-4c3f-a2a6-cb2ea3d24cd3
		else
		  search --no-floppy --fs-uuid --set=root ef08378f-2bf8-4c3f-a2a6-cb2ea3d24cd3
		fi
		linux /boot/vmlinuz-linux root=UUID=b81d987e-fd53-4772-b388-f66b164b86eb rw quiet intel_pstate=disable
		initrd /boot/initramfs-linux.img
	}

Last edited by entodoays (2014-10-29 14:33:32)

Offline

#2 2014-10-26 20:03:44

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Transfer Arch installation

Without information about your partition structure and your grub config file, it is difficult to say: please paste both.


Not an Installation issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-10-26 20:05:21

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: [SOLVED] Transfer Arch installation

Does your fstab use uuids?  Did you update them?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2014-10-26 20:27:35

entodoays
Member
From: Malta
Registered: 2014-10-25
Posts: 118

Re: [SOLVED] Transfer Arch installation

I did update fstab using UUIDs. Here's the root line

UUID="ef08378f-2bf8-4c3f-a2a6-cb2ea3d24cd3"	/         	ext4      	noauto,rw,relatime,data=ordered	0 1

The UUID of the new root partition is ef08378f-2bf8-4c3f-a2a6-cb2ea3d24cd3 but somehow grub.cfg still show the UUID of the external drive.

I modified the grub.cfg manually and managed to boot but I'm worried that the first time Ubuntu updates grub I will end up with a non-bootable Arch. Why's that?

Offline

#5 2014-10-26 22:20:54

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: [SOLVED] Transfer Arch installation

Try running os-prober. That's what I did when I installed a second Arch installation. It will update grub for you.

Offline

#6 2014-10-26 23:45:31

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,901
Website

Re: [SOLVED] Transfer Arch installation

entodoays wrote:

When I choose Arch in Grub it complains that it cannot find the root partition. How do I solve this issue without reinstalling from scratch?

This is the menu entry in grub.cfg:

menuentry 'Arch Linux, with Linux linux (on /dev/sda8)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--ef08378f-2bf8-4c3f-a2a6-cb2ea3d24cd3' {
...
		linux /boot/vmlinuz-linux root=UUID=b81d987e-fd53-4772-b388-f66b164b86eb rw quiet intel_pstate=disable
...
	}

I did update fstab using UUIDs. Here's the root line

UUID="ef08378f-2bf8-4c3f-a2a6-cb2ea3d24cd3"	/         	ext4      	noauto,rw,relatime,data=ordered	0 1

Well, there's your problem. Grub2 thinks your root partition has a different UUID to what you think your root partition's UUID is. The question is, which is the right one?


Also, I'm not sure if quote marks are legal in fstab or not, I'd remove them as a precaution.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2014-10-27 00:05:03

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [SOLVED] Transfer Arch installation

I recall that Ubuntu has a update-grub2 program. I'm not sure if it is the same as update-grub or not (maybe a symlink?), but I'll recommend you to see that. Maybe it could find the correct UUID.

Offline

#8 2014-10-27 18:35:56

andrekp
Member
Registered: 2012-06-07
Posts: 112

Re: [SOLVED] Transfer Arch installation

I also dual boot with Ubuntu.

Your menu entry in grub.cfg looks OK.  The only issue might be that your UUID is incorrect, either in grub.cfg in Ubuntu or in your Anch/etc/fstab

I would recommend going into Ubuntu and running gparted, or whatever you are comfortable with.  Find the actual UUID of your Arch/ partition.

Check your Arch/etc/fstab file and make sure it is correct in there (it likely isn't if you moved your install).  Correct as necessary.

Check your Ubuntu/boot/grub.cfg and correct it in there if necessary.

reboot and see if it works.  That should be all there is to it.

Now I'd recommend:
Go into Ubuntu/etc/grub.d and change the OS prober so that it won't execute.
Take your menu entries for Arch from your Ubuntu/boot/grub.cfg and put them into Ubuntu/grub.d/40_custom
run the command "update-grub" on Ubuntu.

This should create a new Grub menu that has entries for Ubuntu which will update when Ubuntu updates its kernel, and an entry for Arch which works and will never change.

Offline

#9 2014-10-28 16:24:46

entodoays
Member
From: Malta
Registered: 2014-10-25
Posts: 118

Re: [SOLVED] Transfer Arch installation

I'm curious how os-prober finds Linux OS's. Does it look at /etc/fstab? I updated my fstab correctly. Or does it look for the original grub.cfg synced from the original drive (with the wrong UUID's)?

Also, do I need the /boot/grub folder and /boot/grub.cfg in Arch if I'm using Ubuntu's Grub?

Last edited by entodoays (2014-10-28 16:29:21)

Offline

#10 2014-10-28 17:22:02

entodoays
Member
From: Malta
Registered: 2014-10-25
Posts: 118

Re: [SOLVED] Transfer Arch installation

Quote from the http://joeyh.name/code/os-prober/ site:

Since every version of linux does things slightly differently,…, techniques used include parsing /etc/fstab, rummaging around in /boot, parsing grub menu.lst files, etc.

So it seems that fstab is not the only source of information required. The old grub.cfg file is sending os-prober off track. I'll modify it but am still wondering if I can simply delete grub folder and grub.cfg file.

Offline

#11 2014-10-28 22:05:08

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: [SOLVED] Transfer Arch installation

entodoays wrote:

I'm curious how os-prober finds Linux OS's. Does it look at /etc/fstab? I updated my fstab correctly. Or does it look for the original grub.cfg synced from the original drive (with the wrong UUID's)?

Also, do I need the /boot/grub folder and /boot/grub.cfg in Arch if I'm using Ubuntu's Grub?

I'm not sure, all I know is that while it can take a very long time, it always works for me.

Offline

#12 2014-10-28 22:13:35

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] Transfer Arch installation

Read the os-prober script. It uses several different methods to find installed distros.

andrekp has given you the best advice -- create an entry for Arch in 40_custom, and disable os-prober. Unlike Debian/Ubuntu, Arch kernel updates do not need a grub update to work properly, so your 40_custom entry for Arch should work even after Ubuntu grub updates.

And no, you do not have to have grub installed in Arch (so no need for /boot/grub or /boot/grub.cfg in Arch) if you are using Ubuntu as grub controller.

Last edited by 2ManyDogs (2014-10-28 22:15:30)

Offline

#13 2014-10-29 08:09:00

entodoays
Member
From: Malta
Registered: 2014-10-25
Posts: 118

Re: [SOLVED] Transfer Arch installation

Thanks @2ManyDogs for the second advice. I have a question about the first. If I disable os-prober, when Ubuntu updates the kernel newly installed kernel won't be added to Grub since this is done through an update-grub that invokes os-prober. I think that os-prober might have been "confused" with conflicting information in grub.cfg and fstab. Removing the former should resolve the issue. I'll try removing /boot/grub/ and /boot/grub.cfg in Arch and update-grub in Ubuntu and see if it works when I've some time.

Offline

#14 2014-10-29 11:33:53

andrekp
Member
Registered: 2012-06-07
Posts: 112

Re: [SOLVED] Transfer Arch installation

entodoays wrote:

I'm curious how os-prober finds Linux OS's. Does it look at /etc/fstab? I updated my fstab correctly. Or does it look for the original grub.cfg synced from the original drive (with the wrong UUID's)?

Also, do I need the /boot/grub folder and /boot/grub.cfg in Arch if I'm using Ubuntu's Grub?

One of the things it does is look for a folder named /etc/lsb-release

I'm not sure the contents really matter, but mine says:

DISTRIB_ID=Arch
DISTRIB_RELEASE=1
DISTRIB_CODENAME=Arch
DISTRIB_DESCRIPTION="Arch Openbox"

I have found that when OS prober ( in another Linux) doesn't find your Arch system, or when you find you have to mount that Arch/ partition first, that having an lsb-release folder solves that issue every time.  You may, or may not, have installed the program that actually uses this folder, but I find it helpful in dual boot situations to make one if you don't have it.

Offline

#15 2014-10-29 14:29:20

entodoays
Member
From: Malta
Registered: 2014-10-25
Posts: 118

Re: [SOLVED] Transfer Arch installation

So I removed the /boot/grub folder and /boot/grub.cfg file, restarted my PC, booted Ubuntu, updated Grub, restarted again and booted Arch. Ta da! It booted correctly. I noted a few differences in the boot sequence (too quick to notice) but the system booted correctly.

This thread can be marked as solved.

Last edited by entodoays (2014-10-29 14:32:10)

Offline

#16 2014-10-30 07:38:10

entodoays
Member
From: Malta
Registered: 2014-10-25
Posts: 118

Re: [SOLVED] Transfer Arch installation

This solution does work but there's a catch: I had added a parameter to the Arch Grub entry and now that Grub is no longer present, Ubuntu's grub didn't add it obviously. On Ubuntu, the way to add an exec parameter is my modifying /etc/default/grub. If I do this the parameter will be added to the Ubuntu menu entries as well so maybe andrekp's solution is a better one.

Last edited by entodoays (2014-10-30 07:44:10)

Offline

Board footer

Powered by FluxBB