Looking for best setup NFS for camper

Thank you. I have installed Samba 4 and these two: luci-app-samba4 wsdd2

the command you requested:

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                   499.5M      3.0M    496.5M   1% /tmp
/dev/loop0              252.1M     58.9M    123.2M  32% /overlay
overlayfs:/overlay      252.1M     58.9M    123.2M  32% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda1               963.6M      1.2M    896.6M   0% /mnt/sda1
/dev/sda2                 4.5T    412.8G      3.8T   9% /mnt/sda2
/dev/mmcblk0p1           15.7M      7.3M      8.1M  47% /mnt/mmcblk0p1
root@OpenWrt:~#

How do I fix the mount issue, I only want the large partition on Samba share.

As far as what I am looking for, I want to share the entire /mnt/sd2 R/W with everyone on the network. Well maybe require a PW to do R/W and no password for R/O if that is not too difficult. Thank you.

swap is not mounted, but rather enabled. you need to change the partition table to make sda1 have a different partition type, namely the linux swap type. Also after changing the partition type, you need to initialize the swap space, using mkswap

Swap is not mounting:

swapon -a
label buffer too small 1024 > 255

block info | grep "/dev/sd"
label buffer too small 1024 > 255
/dev/sda1: UUID="b8fb5638-8f64-43b7-83b3-64f19ec638bd" VERSION="1.0" MOUNT="/mnt/sda1" TYPE="ext4"
/dev/sda2: UUID="b17147a6-8a0f-644c-9ca1-86c4c1158cee" VERSION="1.0" MOUNT="/mnt/sda2" TYPE="ext4"

free
              total        used        free      shared  buff/cache   available
Mem:        1022976      190080      128664      123852      704232      755104
Swap:             0           0           0

ls -l /mnt/sda1
drwx------    2 root     root         16384 Apr  3 23:58 lost+found

 lsusb -t
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
    |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=orion-ehci/1p, 480M


It still shows sda1 as an ext4 you need mkswap /dev/sda1 to make it a swap volume. Warning this nukes all data on sda1

1 Like

Not entirely sure what commands you've run but here's a quick 'n dirty solution (yes, it's not the safest solution around but it works fine). I reserve the right to have included typos :wink:

=== Partitioning ===

  • Partition your HDD with two slices, one for swap and one for storage (this will nuke anything that's currently on the HDD) and make sure to umount any file systems before continuing.
  • fdisk /dev/sda (based on version 2.34)
  • Print all partitions on the storage device by typing p
  • Delete all partitions using d until you have no partitions left by verifying using p
  • Create a GPT partition table using g
    If it asks whether you want to clear/delete any Windows related information (such as NTFS) select yes
  • Create a new partition using n
    For ending sector/size type +1G (this will create a parition with 1 gigabyte in size)
  • Change partition type to 19 by typing t (Linux Swap)
  • Allocate the rest of your storage device by typing n again, this time you don't need to change any of the values.
  • Verify that your partition table looks sane with p
  • Exit and write your changes by typing w

=== Creating filesystems ===

  • Create swap by using the command mkswap /dev/sda1
  • Create either ext4 or btrfs (you need to have the appropriate packages installed)
    ext4: mkfs.ext4 /dev/sda2
    Packages: e2fsprogs swap-utils (kernel module is already included)
    btrfs: mkfs.btrfs /dev/sda2
    Packages: btrfs-progs (will also pull in the kernel module)

=== Enable auto mount of filesystem and swap ===

  • Install package block-mount
  • Change so all anon and auto values in /etc/config/fstab says 1 instead of 0 using your editor of choice. nano (package) is a good idea if you aren't used to vi.

=== Setup Samba 4.x (this will not sync with the web frontend) ===

  • Install samba package
  • Stop and disable samba
    /etc/init.d/samba stop
    /etc/init.d/samba disable
    
  • Create necessary directories for Samba (smbd) to run
    mkdir -p /var/cache/samba
    mkdir -p /var/lib/samba
    mkdir -p /var/run/samba/ncalrpc
    
  • Put this in /etc/samba/smb4.conf (clear if anything is in it)
    [global]
    workgroup = homegroup
    server string = My NAS Box
    reset on zero vc = yes
    bind interfaces only = true
    interfaces = br-lan
    load printers = no
    disable spoolss = yes
    printing = bsd
    printcap name = /dev/null
    unix extensions = no
    use sendfile = yes
    syslog = 2
    smb encrypt = disabled
    smb passwd file = /etc/samba/smbpasswd
    printable = no
    passdb backend = smbpasswd
    guest account = root
    null passwords = yes
    map to guest = Bad User
    enable core files = no
    encrypt passwords = true
    deadtime = 15
    veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/
    delete veto files = yes
    smb passwd file = /etc/samba/smbpasswd
    
    [exthdd]
    comment = My External HDD
    path = /mnt/sda2/share
    public = yes
    guest ok = yes
    writable = yes
    write list = root
    browseable = yes
    
  • Create a Samba user that matches root account on router including password
    pdbedit -a -u root

=== Misc ===

  • Reboot router to make the sure swap and partition mounts
    You can verify this by using free and df -h

  • Create the directory which Samba will share and set permissions
    mkdir /mnt/sda2/share
    chmod 777 /mnt/sda2/share

  • Start smbd manually and verify that it runs (use top)
    smbd -D -s /etc/samba/smb4.conf

  • Verify that Samba shares are accessable
    On Windows: Run --> \\<ip-to-your-router> ie \\192.168.1.1
    Enter "exthdd" and try to create a directory or copy a file

  • Once that's verified working you can autostart smbd by adding this to /etc/rc.local before exit 0 line
    smbd -D -s /etc/samba/smb4.conf

Done

1 Like

Can't thank you enough! The MiCool is dead after 2 months last summer at 120F +. So I have purchased a couple of firesticks, rooted to stop updates because I am only going to use Kodi only.
https://forum.xda-developers.com/fire-tv/orig-development/unlock-fire-tv-stick-4k-mantis-t3978459
And I replaced the launcher with Leanback with AFTV add-ons
https://forum.xda-developers.com/fire-tv/orig-development/firetv-4k-stick-add-ons-magisk-module-t3979117

And Kodi is working off an OTA connected to the firestick with USB storage at the moment. So I'll try to finalize the server next. Thanks for the detailed guide !!!!!

Ahh, so it didn't run so cool ;-(
The ones I've deployed are still running great however.

Good to hear that it worked out in the end!