Page 1 of 1

Really liking Tiny Core - question about permanently mounting shares

Posted: Wed Aug 14, 2019 9:57 pm
by Fraoch
I'm running Tiny Core on my Pi1B and I'm trying to get everything working that I usually do. I always mount my main workstation's CIFS share and an NFS share from my FreeNAS.

I figured out how to mount shares in TC temporarily. Works fine.

But mounting them permanently is tricky. The share is mounted through /etc/fstab and I back /etc/fstab on shutdown/restart but the issue is - how to back up the mount point? I want to back up the directory but none of the contents - they obviously won't fit on the SD card and actually end up crashing filetool.

I found that by putting the commands to create this share mount point in /opt/bootlocal.sh I can create the share mount point each time I boot and give it the appropriate permissions but I can't mount /etc/fstab in bootlocal.sh, i.e. "mount -a" doesn't do anything.

I tried "sudo mount -a", "/usr/bin/mount -a" and even explicitly mounting it here rather than in /etc/fstab, i.e.

Code: Select all

mount -t cifs //[server IP]/[share] /home/[mount point] -o guest,file_mode=0777,dir_mode=0777,noperm,defaults
which works fine at the CLI once booted but does not mount the share in bootlocal.sh.

I tried putting these commands in /opt/bootsync.sh which runs commands before anything else is booted, no difference.

Any pointers as to what I'm doing wrong?

Thanks.

Re: Really liking Tiny Core - question about permanently mounting shares

Posted: Wed Aug 14, 2019 11:56 pm
by epoch1970
Mhh. You do have the ability to archive your homedir, don’t you? (I don’t remember the name of the command)
In this case I think you home will be loop-mounted by the time fstab is read. So creating an empty directory in you home and then backing up your home would do the trick.

Re: Really liking Tiny Core - question about permanently mounting shares

Posted: Thu Aug 15, 2019 10:28 am
by k-pi
Perhaps using /home=sda1 & /opt=sda1 in your boot line, (remove opt & home from /opt/filetool.lst), will do what you want.

Re: Really liking Tiny Core - question about permanently mounting shares

Posted: Thu Aug 15, 2019 1:44 pm
by Fraoch
epoch1970 wrote:
Wed Aug 14, 2019 11:56 pm
Mhh. You do have the ability to archive your homedir, don’t you? (I don’t remember the name of the command)
In this case I think you home will be loop-mounted by the time fstab is read. So creating an empty directory in you home and then backing up your home would do the trick.
/home is backed up automatically. And if I back up with the share mounted in a /home directory, it attempts to back up everything on the share - even if I had the space, it crashes filetool.

I think you're right about fstab being read before I can create /home/[share] So it reads fstab, does not find the /home/[share] directory and skips it, then my startup script creates the mount point - too late.

It's like I need a shutdown script unmounting the share but keeping the mount point.

Re: Really liking Tiny Core - question about permanently mounting shares

Posted: Thu Aug 15, 2019 4:24 pm
by epoch1970
FWIW my suggestion was to create a dir in /home, not mounting anything, backing up, and rebooting.
I believe unarchiving /home and loop mounts of all sorts happen as part of rootfs setup, hence before fstab is read and executed.

Re: Really liking Tiny Core - question about permanently mounting shares

Posted: Thu Aug 15, 2019 4:45 pm
by Fraoch
epoch1970 wrote: FWIW my suggestion was to create a dir in /home, not mounting anything, backing up, and rebooting.
I believe unarchiving /home and loop mounts of all sorts happen as part of rootfs setup, hence before fstab is read and executed.
The problem if I do that is it tries to back up /home/[mount] before it unmounts it - that crashes filetool. I need to unmount the share first then backup.

Re: Really liking Tiny Core - question about permanently mounting shares

Posted: Thu Aug 15, 2019 9:42 pm
by epoch1970
Ah ok I think I’m starting to understand.
What about mounting to /mnt and adding a symlink from /home/mymount to /mnt?
IIRC the home archive is a tar file, I would expect the archival script will not dereference symlinks.