Squid cache on usb stick (NanoBSD)



  • Hi there,

    yesterday I tried setting up squid on my NanoBSD install and it worked kinda fine. I put a line like this into /etc/fstab:

    /dev/da0 /usb ufs rw,sync,noatime 1 1
    

    Now the first thing I saw, is that the mountpoint was automatically unmounted this morning. It felt like it was right after the periodic PPPoE reset at night. Are there any scripts that could do that? Shouldn't my new mountpoint /usb be mounted automatically?

    Also I saw that some sites open very slowly and some sites do not open at all. For example I wanted to watch live NBA video this morning and the video didn't start at all. Have you guys any good advice on what settings I need to tune with squid for performance? Bandwidth is not the problem, I just want a fast squid install.

    Thanks for any advice!



  • Can anyone tell me why this is not mounted at boot time? Shouldn't this be?



  • @jlepthien:

    Can anyone tell me why this is not mounted at boot time? Shouldn't this be?

    That's in the running config.  Try adding the mount command into the config.xml instead for the mounting to persist between reboots.



  • Thanks. Will check that out!



  • How exactly would I do this? I was looking for fstab entries in the config…
    Isn't there a better method? Where is the original fstab file that gets loaded on boot time? I would like to alter that one instead....


  • Rebel Alliance Developer Netgate

    The fstab is not held in config.xml. It should be left mostly alone though. Some sed commands may be run on it when switching slices, but it should be OK.

    You could use the shellcmd package to run mount directly, though, if you don't want to use fstab.

    The conf_mount_ro() and conf_mount_rw() commands would not have unmounted your device. I don't see anywhere in the code that would have run umount on an item from fstab like that. I'd check your system log, be sure that the usb device didn't disappear or get redetected overnight. I haven't tried it lately, it used to panic a box to unplug a mounted filesystem but that was supposed to be fixed now. I'm not sure if it unmounts when a device is pulled or what happens.



  • Thanks jimp. I'll check the logs the next time this happens…

    The stick wasn't pulled at any time. The mountpoint is not mounted at the moment so it doesn't work automatically when booting. Shouldn't this work on boot time?

    Here's again my fstab...

    /dev/ufs/pfsense0 / ufs ro,sync,noatime 1 1
    /dev/da0 /usb ufs rw,sync,noatime 1 1
    /dev/ufs/cf /cf ufs ro,sync,noatime 1 1
    
    

  • Rebel Alliance Developer Netgate

    I think in /etc/rc it only mounts / and /cf explicitly, not all mountpoints in fstab.



  • Was just looking for the shellcmd package. What do you mean by that package? It is not under packages…
    Or did you mean the command prompt under Diagnostics? I did not find any good solution to have my mountpoint mounted at boot time, yet...


  • Rebel Alliance Developer Netgate

    Somehow the shellcmd package was left out of the 8.x files. Give it 5-10 minutes and look for it again



  • Thanks jimp. Will do that…



  • hello, did you fix the usb mount problem at boot time by now?!



  • I think in /etc/rc it only mounts / and /cf explicitly, not all mountpoints in fstab.
    

    wtf?

    So this is maybe the reason why only / is mounted, when a filesystem-check (due to maintainance or not properly dismounted disks) occurs? I have had an installation with /var and /home on separate slices, but only problems due to the not mounted filesystems. I switched that out by having only one slice, but I'm not really glad with this situation, so a stock freeBSD on EVERY boot mounts ALL filesystems!

    It would be nice to change that behaviour please! I want back my different slices!


Log in to reply