My assumption is that all drives from /etc/fstab are mounted before /etc/rc.local is executed ony my RPI2.
My /etc/fstab looks like the following:
UUID=70BCEC34BCEBF310 /mnt/wde4tb ntfs rw,nosuid,nodev,relatime,uid=1000,gid=113,permissions,umask=007,nofail 0 0
UUID=74A6-7F41 /mnt/sd64gb vfat defaults,nofail 0 0
UUID=2efde1bd-42b1-428e-a76d-5910d62a0e9a /mnt/ks32gb ext4 defaults,nofail 0 0
If I run this command from the shell I get proper response:
osmc@osmc:~$ sudo hdparm -S 241 $(mount | grep wde4tb | awk
'{print $1}')
/dev/sda1:
setting standby to 241 (30 minutes)
I have put the same command in /etc/rc.local (without sudo) but looks like it is not executing upon reboot.
In order to check what is going on I have put some diagnostic in the /etc/rc.local file:
sleep 10
echo "start" > /home/osmc/rc.local.output
echo '-----mount-----' >> /home/osmc/rc.local.output
mount >> /home/osmc/rc.local.output
echo '-----mount grep-----' >> /home/osmc/rc.local.output
mount | grep wde4tb >> /home/osmc/rc.local.output
echo '-----mount grep awk-----' >> /home/osmc/rc.local.output
mount | grep wde4tb | awk '{print $1}' >> /home/osmc/rc.local.output
echo '-----hdparm-----' >> /home/osmc/rc.local.output
hdparm -S 241 $(mount | grep wde4tb | awk '{print $1}') >> /home/osmc/rc.local.output
echo "end" >> /home/osmc/rc.local.output
After rebooting the /home/osmc/rc.local.output looks like the following:
start
-----mount-----
devtmpfs on /dev type devtmpfs (rw,relatime,size=370540k,nr_inodes=92635,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /run type tmpfs (rw,relatime)
/dev/mmcblk0p2 on / type ext4 (rw,noatime,stripe=1024,data=ordered)
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/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/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
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)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (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 /mnt/ks32gb type ext4 (rw,relatime,data=ordered)
/dev/sdc1 on /mnt/sd64gb type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
sysfs on /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq type sysfs (rw,relatime)
-----mount grep-----
As you can see there is ks32gb and sd64gb from fstab, but there is no wde4tb (sda1) drive.
After boot process is completed, mount shows the wde4tb drive:
osmc@osmc:~$ mount
devtmpfs on /dev type devtmpfs (rw,relatime,size=370540k,nr_inodes=92635,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /run type tmpfs (rw,relatime)
/dev/mmcblk0p2 on / type ext4 (rw,noatime,stripe=1024,data=ordered)
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/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/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
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)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (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 /mnt/ks32gb type ext4 (rw,relatime,data=ordered)
/dev/sdc1 on /mnt/sd64gb type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
sysfs on /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq type sysfs (rw,relatime)
/dev/sda1 on /mnt/wde4tb type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=75108k,mode=700,uid=1000,gid=1000)
Can someone explain to me why I can’t see wde4tb mounted from rc.local but I can see other drives?