Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: jbbum on June 26, 2019, 09:08:40 AM
-
Where and how does piCore update fstab when usb device is attached. Would like to add a mount command to the fstab update function.
-
Hi jbbum
The update is initiated by udev. I think it happens in /etc/udev/rules.d/98-tc.rules. Look for the lines containing rebuildfstab.
-
Thanks Rich.
-
You can run 'updatefstab' command manually or in a script to update fstab.
-
Just a couple of points, I think...
/etc/fstab is dynamically created during the boot process by rebuildfstab, unless the nofstab bootcode is set .
Mounts have "noauto" option set automatically so $ mount -a isn't much use.
-
I added a mount command at approximate line #88 in rebuildfstab to mount $DEVNAME. Added it in the if statement that checks if device is already mounted and right after the mkdir command.
mount /dev/$DEVNAME /mnt/$DEVNAME
This automounts usb devices for a photo frame controlled by python
-
hi jbbum,
It might be better if you add your mount command in /opt/bootsync.sh. This gets backed up and will be persistent. /opt/bootsync.sh and /opt/bootlocal.sh are there for adding commands that need to run at startup.
Usually, it's best not to modify TinyCore/piCore commands.
I haven't used piCore for a while, but there was a stage where USB drives did automatically mount, via udev I think.
rebuildfstab runs during the boot process and also when you hot plug USB disks.
The mount command can be just $ mount /dev/$DEVNAME as the command uses the mount point found in /etc/fstab.
regards
Greg
-
Hi Greg Erskine
... I haven't used piCore for a while, but there was a stage where USB drives did automatically mount, via udev I think. ...
I think that's what he is looking to accomplish, auto mounting USB drives when they get plugged in.
-
Rich, that is exactly the procedure I am trying to do. My python script reads the dirs in /mnt and provides a button to open and display the images from that dir. So when a usb drive is inserted the images are available to the photoframe. This is all done on a touch screen, no keyboard.
-
Hi jbbum
If you are interested, there is an automount script I wrote posted here:
http://forum.tinycorelinux.net/index.php/topic,23337.0.html
I've been running it for about 5 months now and it works quite well.