BobSwi
Posts: 5
Joined: Wed Oct 03, 2012 5:45 am

Issue after Jessie upgrade

Mon Nov 30, 2015 9:20 pm

I upgraded to jessie over the the weekend, everything mostly went as planned. I have nginx installed with a site stored on /data which is mounted from /dev/sda1 on boot, and I've had bootdelay=5 in cmdline.txt since wheezy.
However now, after every few reboots, my USB drive is not available or seems to be mounting late and nginx fails with:
2015/11/30 15:08:22 [emerg] 403#0: open() "/data/.../logs/error.log" failed (2: No such file or directory)
I can start nginx manually after I log in and it runs fine, or even just reboot the pi and it comes up fine sometimes.
Is there someplace I can check if something else is happening during boot?

Thanks!

User avatar
DougieLawson
Posts: 39136
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Issue after Jessie upgrade

Mon Nov 30, 2015 11:20 pm

What's in /etc/fstab?

Change

Code: Select all

/dev/sda1  /data ext4 defaults,noatime 0 0
to

Code: Select all

/dev/sda1   /data  ext4 defaults,noatime,x-systemd.automount 0 0
Or even better change it to

Code: Select all

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /data     ext4    defaults,noatime,x-systemd.automount       0 0
where you get the UUID by running blkid /dev/sda1 then it doesn't matter if your drive appears as /dev/sda1 or /dev/sdq1 it will still mount.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

BobSwi
Posts: 5
Joined: Wed Oct 03, 2012 5:45 am

Re: Issue after Jessie upgrade

Mon Nov 30, 2015 11:34 pm

Thanks, i'll set that up and test. My current fstab was

Code: Select all

/dev/sda1  /data  ext4  defaults,nofail 0 2
Edit: Thanks, that seems to have done the trick, everything is working after multiple reboots!

Tom_A
Posts: 272
Joined: Fri Dec 06, 2013 8:34 am

Re: Issue after Jessie upgrade

Tue Dec 01, 2015 4:00 pm

DougieLawson wrote:What's in /etc/fstab?

Change

Code: Select all

/dev/sda1  /data ext4 defaults,noatime 0 0
to

Code: Select all

/dev/sda1   /data  ext4 defaults,noatime,x-systemd.automount 0 0
Or even better change it to

Code: Select all

UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /data     ext4    defaults,noatime,x-systemd.automount       0 0
where you get the UUID by running blkid /dev/sda1 then it doesn't matter if your drive appears as /dev/sda1 or /dev/sdq1 it will still mount.
I seem to remember having to do something extra to get UUIDs to work with Wheezy on USB installs. Is this no longer necessary?

User avatar
DougieLawson
Posts: 39136
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Issue after Jessie upgrade

Wed Dec 02, 2015 12:35 am

The UUID for my Jessie system that has a rootfs on a hard drive works without any struggle. The UUID is in /boot/cmdline.txt and in /etc/fstab.

cmdline

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rootfstype=ext4 elevator=deadline rootwait rootdelay=5
fstab

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /     ext4    defaults,noatime       0 1
#/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
#
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Issue after Jessie upgrade

Wed Dec 02, 2015 6:28 am

Tom_A wrote:[I seem to remember having to do something extra to get UUIDs to work with Wheezy on USB installs. Is this no longer necessary?
Was it something to do with using an initrd? I think dougie mentioned that he'd done that at some point.

User avatar
DougieLawson
Posts: 39136
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Issue after Jessie upgrade

Wed Dec 02, 2015 12:31 pm

rpdom wrote:
Tom_A wrote:[I seem to remember having to do something extra to get UUIDs to work with Wheezy on USB installs. Is this no longer necessary?
Was it something to do with using an initrd? I think Dougie mentioned that he'd done that at some point.
I've got an initramfs created with mkinitramfs -o /boot/initrd.sda and referenced with

Code: Select all

initramfs initrd.sda followkernel
in config.txt
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Raspberry Pi OS”