Linux OSMC installer fails USB install

As in the topic, the install to the Micro-SD card works, but it fails to mount the partition to /tmp/osmc_mnt, so does not write the preseed file. The Pi then doesn’t know to use the USB stick, so it installs to the SD card, not the USB stick as desired.

This happens every time. What information can I gather so the installer can be fixed?

Thanks

What distro are you using? There should be a log in the home directory

Sam

I’m using Linux Mint 18.3 Sylvia.

In case it may help, here’s the install log for one attempt:

Thu Jun 7 21:09:48 2018 OSMC Installer running on Linux
Thu Jun 7 21:09:48 2018 Detected locale as en_PH
Thu Jun 7 21:09:48 2018 Attempting to load translation for locale en_PH
Thu Jun 7 21:09:48 2018 Could not load translation!
Thu Jun 7 21:09:48 2018 Resolving a mirror
Thu Jun 7 21:09:49 2018 Resolved mirror to http://ftp.acc.umu.se/mirror/osmc.tv/osmc/download/
Thu Jun 7 21:09:49 2018 Enumerating supported devices
Thu Jun 7 21:09:49 2018 Added the following devices
Thu Jun 7 21:09:49 2018 Vero 4K
Thu Jun 7 21:09:49 2018 Vero 2
Thu Jun 7 21:09:49 2018 Vero
Thu Jun 7 21:09:49 2018 Raspberry Pi 1 / Zero
Thu Jun 7 21:09:49 2018 Raspberry Pi 2 / 3
Thu Jun 7 21:09:49 2018 Apple TV
Thu Jun 7 21:09:49 2018 Checking for updates
Thu Jun 7 21:09:49 2018 Checking for updates by downloading http://ftp.acc.umu.se/mirror/osmc.tv/osmc/download//installers/latest_linux
Thu Jun 7 21:09:51 2018 Acquired mirror file
Thu Jun 7 21:09:51 2018 No new update is available
Thu Jun 7 21:10:01 2018 The user has selected English as their language
Thu Jun 7 21:10:01 2018 The user has selected Raspberry Pi 2 / 3 as their device
Thu Jun 7 21:10:01 2018 Attempting to download device versions file http://ftp.acc.umu.se/mirror/osmc.tv/osmc/download/installers/versions_RBP2
Thu Jun 7 21:10:02 2018 Found a build called 2018.04-1
Thu Jun 7 21:10:02 2018 Found a build called 2018.03-2
Thu Jun 7 21:10:02 2018 Found a build called 2018.02-1
Thu Jun 7 21:10:02 2018 Found a build called 2018.01-1
Thu Jun 7 21:10:02 2018 Found a build called 2017.12-1
Thu Jun 7 21:10:02 2018 Found a build called 2017.10-1
Thu Jun 7 21:10:02 2018 Found a build called 2017.08-1
Thu Jun 7 21:10:02 2018 Found a build called 2017.07-1
Thu Jun 7 21:10:02 2018 Found a build called 2017.06-1
Thu Jun 7 21:10:02 2018 Found a build called 2017.05-2
Thu Jun 7 21:10:02 2018 Found a build called 2017.04-1
Thu Jun 7 21:10:02 2018 Found a build called 2017.03-1
Thu Jun 7 21:10:02 2018 Found a build called 2017.02-2
Thu Jun 7 21:10:02 2018 Found a build called 2017.01-1
Thu Jun 7 21:10:12 2018 The user has selected a local image for Raspberry Pi 2 / 3 with file location: file:///home/my/OSMC_TGT_rbp2_20180502.img.gz
Thu Jun 7 21:10:12 2018 Disabling internal install for device Raspberry Pi 2 / 3 as it does not support it
Thu Jun 7 21:10:23 2018 USB installation selected
Thu Jun 7 21:11:00 2018 Wireless network configured with SSID XXXXXXXX key value XXXXX
Thu Jun 7 21:11:00 2018 Running partprobe to inform operating system about partition table changes
Thu Jun 7 21:11:01 2018 Enumerating imageable devices for Linux
Thu Jun 7 21:11:01 2018 New disk device entry created with entry point /dev/loop0, 256MiB free space and label
Thu Jun 7 21:11:01 2018 New disk device entry created with entry point /dev/loop1, 256MiB free space and label
Thu Jun 7 21:11:01 2018 New disk device entry created with entry point /dev/loop2, 256MiB free space and label
Thu Jun 7 21:11:01 2018 New disk device entry created with entry point /dev/loop3, 256MiB free space and label
Thu Jun 7 21:11:01 2018 New disk device entry created with entry point /dev/sda, 465.8GiB free space and label
Thu Jun 7 21:11:01 2018 New disk device entry created with entry point /dev/sdb, 3.7GiB free space and label
Thu Jun 7 21:11:13 2018 Device selected: 120 /dev/sdb 3.7GiB
Thu Jun 7 21:11:17 2018 EULA has been accepted
Thu Jun 7 21:11:17 2018 Extracting /home/my/OSMC_TGT_rbp2_20180502.img.gz
Thu Jun 7 21:11:26 2018 Finished extraction. Going to write image
Thu Jun 7 21:11:26 2018 Requesting confirmation from user
Thu Jun 7 21:11:31 2018 User confirmed
Thu Jun 7 21:11:31 2018 Unmounting /dev/sdb
Thu Jun 7 21:11:31 2018 Running partprobe to inform operating system about partition table changes
Thu Jun 7 21:11:33 2018 Writing /home/my/OSMC_TGT_rbp2_20180502.img to /dev/sdb
Thu Jun 7 21:12:23 2018 Running partprobe to inform operating system about partition table changes
Thu Jun 7 21:12:24 2018 Image successfully written to device
Thu Jun 7 21:12:24 2018 Deleting the uncompressed image to save space
Thu Jun 7 21:12:24 2018 Creating preseeder
Thu Jun 7 21:12:24 2018 Adding preseed stringd-i target/storage string usb
Thu Jun 7 21:12:24 2018 Adding preseed stringd-i network/interface string wlan
Thu Jun 7 21:12:24 2018 Adding preseed stringd-i network/auto boolean true
Thu Jun 7 21:12:24 2018 Adding preseed stringd-i network/ssid string XXXXXXXXX
Thu Jun 7 21:12:24 2018 Adding preseed stringd-i network/wlan_keytype string 1
Thu Jun 7 21:12:24 2018 Adding preseed stringd-i network/wlan_key string XXXXXXXX
Thu Jun 7 21:12:24 2018 Writing preseeder
Thu Jun 7 21:12:24 2018 Running partprobe to inform operating system about partition table changes
Thu Jun 7 21:12:25 2018 Mounting the first filesystem on /dev/sdb
Thu Jun 7 21:12:25 2018 Trying to umount before we are remounting and writing the preseed.
Thu Jun 7 21:12:25 2018 Unmounting /dev/sdb1
Thu Jun 7 21:12:25 2018 Running partprobe to inform operating system about partition table changes
Thu Jun 7 21:12:25 2018 Unmounting /dev/sdb
Thu Jun 7 21:12:25 2018 Running partprobe to inform operating system about partition table changes
Thu Jun 7 21:12:26 2018 Mounting /dev/sdb1 to /tmp/osmc_mnt
Thu Jun 7 21:12:26 2018 Could not mount filesystem!

Either the installer isn’t running with the correct permissions or something like an automounter is hogging the device.

I don’t automount anything.

Does the installer need to be run by root?

Yes – to write to block level devices and mount filesystems, it needs privileges.

If it need privileges, shouldn’t it get them automatically? I installed the installer and invoked it from the menu. There was no warning that it needed to be run by root. If it doesn’t work when you do that then it should only be in sbin where only root has access to it.

We ask for sudo rights using a variety of different methods, depending on the distribution.

However some distributions are customised (either by maintainer or by user) which means this may not always work.

If you plan to write to devices at a block level or mount a filesystem, you will always need privileges.

Funny, the SD card had been mounted and formatted already, and written to successfully. The failure is attempting to remount it to write the preseed. It seems a request for sudo rights has been missed.

I doubt that.

An automounter is probably catching it.
Does Mint still use that autofs crap?

Checked the source again for my reference.
The program needs to be run as root, and you should be prompted for this when you run the installer.

No – the installer only mounts the card after imaging. It does not do any formatting. A mount will only be attempted if you use any preseeding options.

This is how we start with privileges, or at least attempt to:

if [[ $EUID -eq 0 ]]; then
    $cmd
elif command -v gksudo; then
    gksu -k $cmd
elif command -v kdesu; then
    kdesu $cmd
elif command -v xdg-su; then
    xdg-su -c $cmd
else
    sudo $cmd
fi

Yes, you are correct. The above code automatically sets the user to root to invoke the installer. In fact that works, as shown here:

my-TravelMate-B115-MP my # ps -efl | grep -i osmc
0 S my 26261 23371 0 80 0 - 168779 poll_s Jun07 ? 00:00:01 /usr/bin/xed /home/my/osmc_installer_log.txt
0 S my 30088 1745 0 80 0 - 3133 wait 07:27 ? 00:00:00 /bin/bash /usr/share/osmc/osmcinstaller
0 S my 30093 30088 3 80 0 - 42407 hrtime 07:27 ? 00:00:01 gksu -k /usr/share/osmc/qt_host_installer
4 S root 30094 30093 0 80 0 - 22913 poll_s 07:27 ? 00:00:00 /usr/bin/sudo -E -S -p GNOME_SUDO_PASS -u root /usr/share/osmc/qt_host_installer
4 S root 30095 30094 2 80 0 - 135049 poll_s 07:27 ? 00:00:00 /usr/share/osmc/qt_host_installer
0 S root 30103 29826 0 80 0 - 3556 pipe_w 07:28 pts/4 00:00:00 grep --color=auto -i osmc
my-TravelMate-B115-MP my #

So, obviously it’s not a permissions problem.

Autofs is not installed by default in Mint. I don’t have it in my system. One of the first things I did after install is disable all the automount stuff I could find.

Can we get the error code from the failed mount somehow?

First thing I’d check is if this directory is being created properly

Sam

Yes, that was in fact the first thing I checked.
Here’s what’s there:
4 drwxr-xr-x 2 root root 4096 Jun 7 17:23 osmc_mnt

I tried a manual mount with root to that directory and it worked fine.

Maybe partprobe fails on your system so the new partitions aren’t populated.
Check if you have partprobe.

Yes, partprobe is installed.

Again, the install works to the point that I can use the media to install and run OSMC. Only(as far as I know) the preseed stuff doesn’t get done,

I tested on my Mint 18.3 and have the same problem. Could you try this:

sudo systemctl stop udev systemd-udevd-kernel.socket systemd-udevd-control.socket

and then run the installer. To turn udev back on:

sudo systemctl start udev systemd-udevd-kernel.socket systemd-udevd-control.socket

Disabling that systemd component allowed the install to work correctly. The preseed file now is now created and stored on the install micro-SD card.

Thanks for that. So what is the long term fix? Something in the installer of something in Mint/systemd?

We will have to look into the proper long term fix. Thank you for helping by confirming my test!

Can you show me the udevadm events @bmillham?

Cheers