Kernel panic with external hdd's connected

When I have my external hdd’s connected, on boot, I get a kernel panic every time. When I disconnect them during boot, I also get a kernel panic because it expects to be able to load the drives (this might be a mistake I made in fstab though). The only way to boot my device is to unplug the powered usb hub that I use for my drives, wait for osmc to boot, and plug in my usb hub during the time-out in trying to find the drives.

Please take a screen shot of the kernel panic and provide more information such as full debug logs including your fstab file.

Follow up to this, since I have the same issue.

I think that I fixed this while I was on RC2 by making a change to my fstab file, but I can’t remember exactly what that change was (I’ve since done a reinstall and forgot to back it up…) :unamused:

Here’s my fstab:

/dev/mmcblk0p1  /boot    vfat     defaults,noatime    0   0
/dev/sda1  /    ext4      defaults,noatime    0   0

and results of mount

/dev/sda1 on / type ext4 (rw,noatime,stripe=1024,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=372052k,nr_inodes=93013,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /media/media type ext4 (rw,relatime,data=ordered)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
sysfs on /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq type sysfs (rw,nosuid,nodev,noexec,relatime)
/dev/sdb2 on /media/c5d9e11a-991d-40fa-a1b7-91d701cdf811 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=75272k,mode=700,uid=1000,gid=1000)

(the external drive partitions are /dev/sdb1 and /dev/sdb2.)

If I boot the Pi (model 2, running OSMC RC3 on a USB drive) with the external drive connected, I get a kernel panic. If it is unplugged then it’ll boot up fine, then I can plug the drive in.


Please post a picture of the kernel panic - without seeing the details there’s not a lot we can do.

Here is my fstab file:

osmc@osmc:/var/log$ cat /etc/fstab
/dev/mmcblk0p1  /boot    vfat     defaults,noatime    0   0
/dev/sda1  /    ext4      defaults,noatime    0   0

UUID=ae8de1f5-6b6c-4ea4-be85-a5e376560c67       /home/osmc/data1        ext3   d                                                                                                                                                                 efaults 0       0
UUID=b630862a-ba4a-4f56-b8c4-ad6fec8837d3       /home/osmc/data2        ext3   d                                                                                                                                                             efaults 0       0

When booting with drives plugged in:

When booting with drives not plugged in:

It is before this timeout ^ that I have to plug in my drives, or it says dependency failed.

You’re using a USB install, right ? (OS installed on an external drive) And then a second USB drive for media files ?

Try swapping which USB socket each drive is plugged into at the Pi - the kernel is probably detecting your Data drive as /dev/sda therefore it can’t find the root filesystem.

Swapping their USB ports should change the device detection order.

I am hard linking on UUID in my fstab file, so I do not see how it should do this. The USB is in the same USB port it was put in during install, and when I swap it around it doesn’t change anything either. I used to have this back on my pi1 raspbmc RC1 etc, at some point it just went away, now on OSMC it’s back.

The USB flashdrive is plugged into a socket, my drives are plugged into a usb hub which is plugged into another. Changing the ports does not help. The hub is powered by it’s own power source.

You’re not specifying a UUID for the root partition though.

Also I’m not sure whether we actually have UUID support compiled into the kernel. (It was not there for the Alpha releases)

Find the UUID for your root drive and add that to fstab too.

Identifying in cmdline might be cleaner

You must have UUID support since my drives mount to the correct folders (non-default). And since my drives mount to the correct folders, shouldn’t my root drive be the only possible one left for /dev/sdb? Regardless I will try mounting my root drive by UUID. I would honestly think this should be done by default anyway, but whatever, I’m not a linux dev so I’m sure you have a reason for not doing so.

I’m sorry but I don’t see that thread reflecting what you’re saying at all.

The root partition is shown as /dev/sda1 in your fstab file, why do you think it would work as /dev/sdb ?

If you use the root=PARTUUID=xxxxx in your cmdline.txt then there will be no confusion of which to mount as / at boot time.

That was a typo.

Thanks. I was going to reply with an image of the error but Mobrockers beat me to it.

The PARTUUID line in my /boot/cmdline.txt fixes the error.

For anyone wondering, my /boot/cmdline.txt now looks like this:

root=PARTUUID=000f07e3-01 rootfstype=ext4 rootwait quiet osmcdev=rbp2

Got the PARTUUID like this:

osmc@osmc:~$ blkid /dev/sda1
/dev/sda1: UUID="5d31425a-288e-4963-be07-534286b8ec2e" TYPE="ext4" PARTUUID="000f07e3-01"

Think I was confused as I seem to remember something about UUID support being removed in Raspbmc? Anyway, thanks all.