OpenWRT - File Sharing Server on OpenWRT with Samba4 (SMB)
HTML-код
- Опубликовано: 21 июл 2024
- In this video, we will configure File Sharing server on OpenWRT with Samba4 (SMB). For this tutorial, I used a USB 3.0 SSD (USB Attached SCSI device) and connected the hard disk to the USB 3.0 port on the Linksys WRT1900AC to achieve the highest file transferring speed. You can connect the hard disk to a USB 2.0 port but the speed is slower. Besides USB hard disk, a normal USB drive or USB printer will be supported by Samba.
Since most of the tutorial on the internet is about Samba 3; I decided to make one for Samba 4. I hope it will help you to get the setup working.
Video timeframe:
00:00 - Intro
01:35 - File Sharing with OpenWRT Router Procedure Overview
02:18 - Install Packages - USB Storage, Block-Mount & NTFS support
04:54 - Mont the USB hard drive on OpenWRT with Block-Mount
06:03 - Install Samba4 Server with Putty (CLI)
08:35 - Install luci-app-samba4 & configure Samba4 on LuCI
08:57 - Configure Samba4 on LuCI
11:14 - Create Samba user (Network driver user)
14:56 - Map new Network Drive on Windows 10 & File transfering Speedtest
16:44 - Connect to the Network Drive on Smartphone with Cx File Explore
Resources:
- Samba Configuration - openwrt.org/docs/guide-user/s...
- USB Storage Drivers - openwrt.org/docs/guide-user/s...
- NTFS Read & Write support - openwrt.org/docs/guide-user/s...
- Block-Mount - openwrt.org/docs/techref/bloc...
Thanks for watching and see you in the next video! Наука
This is perfect. I have been putting of installing Samba for so long.
Great guide, worked on my WRT3200ACM on OpenWrt 22.03.2 with one change at the step where you're mounting /dev/sda I ran "ln -s /usr/bin/ntfs-3g /sbin/mount.ntfs" from terminal. This allowed the drive to mount when previously applying the enable option would result in no change. This step is at 5:41
My favorite part is at 15:07.
Your videos are great by the way. Very helpful.
Glad you like them!
just spent 30m-1hr trying to get the permissions right by myself. Should have looked at your video first, got it done in 5min! Best tutorial on the internet!!
I followed everything and still I do not have read and write it says the system is write protected
This was easy and clear. Thank you.
This is a really useful video. Thank you for making it !!
Glad you enjoyed it!
Thanks for the tutorial man.
U are awesome.
Thank you!! finally i got it right by folowing your instructions!
Glad it helped!
@@VanTechCorner now its sharing a small disk instead of the usb external drive
now this is what ive been waiting for!! thankyou so much van 😆😆
btw, im using x86 openwrt and i want to share one of my folder in my hdd
i hope its work
well, i want to share my ext4 on my harddrive but i cant make it work 😢
nvm its already work hehe 👌 thankyou once again
can you do one for ksmbd on openwrt? the package size is much smaller, and the luci interface is very similar.
Well done sir but do you have a video explaining how to setup a way to access the usb ssd from outside the home network?
I have installed openwert on an zyxel nsa325 v2 yesterday and want to share an internal sata drive. Not an usb drive. Do you know if that's possible?
I face so many troubles in order to this work. Finally, the options that work for me "rw,nodev,noexec,noatime,nosuid,uid=xxxx,gid=xxxxx" By passing those options and special mention to uid and gid did the magic. They need to match your user. BTW, I'm using samba4
I'm using samba for the local nas network, can the files on the HDD be accessed via luci or not?
Hello , I just installed the x86 EFI openwrt version 21.02.0 , just released a few days ago ,
on a machine and then enlarged the partition as you do and it all went well and the system said it was successful ... however when booting it up the system would not boot all the way and give message ' waiting for root device PARTUUID ' wondering if this is due to EFI , this is the first time I have seen an EFI listed in the default stable versions
Maybe there is another task that needs to be done , do you know what the cause and fix is .
thanks for your help !
I'm having a problem.. I've followed the tutorial but my hdd can't be written, it can only be read.. what's wrong?
I'm stuck on the network drive mapping, I keep getting issues with certificates and nothing seems to work. Have you experienced this problem?
Can you please make another video toturial for ksmbd because samba a way to big for my WRT1900ACS. Can't install any update after using samba.
how do you configure share without level user access I can't figure out
I have router without usb but i have modem with usb. How can i access to that usb on openwrt and add?
If you use 1Gbps links between your router and PC, how fast can you get? I feel that the router becomes a bottleneck, even if you use a HDD
hello, I am running the OpenWrt 21.02 on the Linksys WRT32X and managed to install USB storage, Block-Mount and Samba4 following your video, but after installed the Luci-app-samba4, the new "Service" menu didn't show up. Appreciate if you can answer what I done wrong. stay safe!
Hii.. i just wonder can I access the file online, upload and download without connect with same WiFi?
I'm unable to copy large files. Saying there is not enough space on device but I have a 1TB HDD mounted on the router. Anyone who can help?
I have successfully configured the share and permissions. I can see that in windows and phone bit when I try to access I get access denied. All SAMBA Share username and password logs on also fine. still access denied
Can't install on Dir842 right. I got not enough space error.
such a great vid :)
keep it up
Thank you so much!
the share is not accessible ?
Excelente vídeo.
Estou tentando instalar openwrt em um TP-Link 750n. Desejo instalar nele rclone, montar GoogleDrive como disco, local. Fazer com que seja montado automaticamente no boot. Com a flag --destiny ( -) do opkg, instalar os pacotes como openvpn, samba, ddns, Lucy nesse reclone montado. Porém estou com dificuldade para fazer com que o rclone já monte o disco no start
ThankYou I installed the kmod packages and Ntfs 3G then Reboot now after rebooting my Belkin RT3200 is dead which I bought new Yesterday 😢
My drive does not show up in Mounted file systems until I installed package "kmod-fs-ntfs" which did not mention in the video.
Using kmod-fs-ntfs only provides read support while ntfs-3g provides both read & write support. You need to reboot the router after installed ntfs-3g. More info on the OpenWRT docs (links in video's description)
Thank you
Excellent work this video!! Is possible make a video about config https on luci and proton vpn on openwrt 20?
what model of linksys you use on the video, bro?
Hi, it is the Linksys WRT1900AC.
not working , untill adding rule into firewall
I just got myself an used WRT1900ac V2 to test drive openwrt. I'm new to linux and openwrt. I tried few different USB HDD and USB drive. Nothing seems to be working. I read some articles online saying if the drive is being detected it should show under the /dev. What is simplest way to determined the drive is working or not? Thanks.
Hey, the easiest way is connect the device into your computer, go to Disk Management to verify that.
thanks a lot :)
At 12:36 you say "press the exe keys and then columns and right click hit enter". I can't quite understand how to do that. What is the exe key?
ESC. You can learn the basic of VI editor to understand how to edit a text file in Linux.
Thanks for the tutorial! How come samba wont let files/directories be named with a colon ( : ) ?
:Illegal Filename Characters
Hello, My router doesn't have enough space to install samba4, is there any other package I can use to enable file sharing which lighter than samba4?
Does your router has USB port with it?
@@a892728 Yes.
@@Nazmul.Alam_
1.try extroot
2.use chfs as http file server
hello, thanks for the great videos
i already try it and it works, but when i restart my x86 openwrt it not want to connect, any suggest?
Hi, sorry for the late response. Did you solve the problem?
@@VanTechCorner hi, actually no
so i just reinstall my openwrt and its work fine
How to change User and Password
I have no ideea what you said after inserting new user
You can read the guide in the video description.
I managed to get the drive to mount after some tries and succeeded in going through the tutorial. But when I upgraded my OpenWRT to 22.03.1, it deleted all the settings and I had to reinstall. This time I just can't get the drive to mount!! All drivers are installed and I can see the drive under Mount Points menu. So what didn't I do right?
I'm having the same problem.
I figured it out. I was missing the kmod-fs-ntfs package, which another commenter notes that it wasn't mentioned in the video. Good luck buddy!
@@SteelTumbleweed thanks for the tip! Appreciate it!
@@johnpang864 I think there might be a legitimate bug on the latest version. By attempting to use kmod-fs-ntfs I get an access denied when attempting to access the drive. I found a workaround which is to manually mount the drive using just ntfs-3g, uninstalling kmod-fs-ntfs and going to ssh and typing in: ntfs-3g /dev/sda1 /mnt/sda1 -o rw,big_writes
@@SteelTumbleweed OK thanks!
verify_pkg_installable: Only have 4912kb available on filesystem /overlay, pkg samba4-libs needs 7010
* opkg_install_cmd: Cannot install package samba4-server.
same problem, altought i have 115mB free space it said i dont have space enough to install it
Sir..can we use this on the raspberry pi openwrt server? and can it work with usb printer?
Hi, you can surely use this with RPI running OpenWRT. Samba does support USB printer but I have yet to try. Maybe you can give a try and share the result.
@@VanTechCorner I see...thank you for your feedback..I'll share the result once I've try it
you can try printer with p910nd
It wont let me write from windows? It says i dont have permission
Hi, how about usin a phone? Did you enable write in Samba configuration. May I know what is the format of the USB device/ HDD that you are using?
Can i request for torrent install guide in openwrt 😅
can i do it on r2s?
Yes it will work just fine, as long as you can install the packages. However, the speed will be lower since R2S only has USB 2.0.
Does this work with FAT32 and ExFAT formatted drives?
For ExFat maybe it work, but fat32 doesn’t.
@@VanTechCorner thanks for your reply. Is FAT32 possible and do you have a video on this, thank you.
Hi, fat32 is not working with this kind of sharing.
@@VanTechCorner ok thank you.
Too bad, looks like the samba4 packages might be too big for my router (~10mb max storage 😢). Great content!
you should still be able to remote mount a -ram- drive then use that as your bigger/extra home dir using sshfs perhaps.
use a cheap pi4 -with usbc 8 in 1 USB C Hub Dongle with Ethernet ,sd cards etc- as a master openwrt then relegate your old router to a openwrt client.
If you have 2 or more usb ports you can use extroot to increase the storage and install whichever packages you need.
@@ItGuyTechTips @paul maydaynight both good options, thanks guys. It's a mobile setup, so I have the phone USB tethered through the router's single USB port. Maybe I can route the traffic through USB-to-Ethernet adapter, then hook an external drive through the USB 🤔
@@johnweldon1932 which exact router do you have?
If you dont want to do extroot, there is a hard way, compile your own image and include samba packages. The filesystem in OpenWrt has two layers, one compressed read-only and one modifiable. Something in the latter layer takes tens of megabytes could be just a few megabytes in the former layer.
are you on gigabit connection?
At the time of making this video - no
Now - yes, and sometime I get up to 2Gbps throughput. You can check out my recent videos :)
@VanTechCorner i get 70mb/s max on gigabit with 5ghz wifi on ipad. but my phones wifi cant go past 433mbps on 5ghz. so the speed on phone is 25mb-ish something. even my phone supports AC wifi...on pc i get 110 mbps over smb and ftp.
8:48 i have only 4.9 mb left - cannot continue any further
ksmbd works as alt. to samb4
using it as guest because it is a private network anyway and samba cmdlines and ksmbd cmdlines were different in password part... i am at my limits with the troubleshooting
but yeah working. would like to automatically store screenshots there
Thanks for the update bro! It is good that you solved the space limit problem.
Argh! This is so frustrating. OpenWRT don't allow ssh to the router if it's not its default 192.168.1.1, so your command line instructions are useless to me with my device connected into my network the way it is.
I cant default it back because then it won't have internet access.
Why on Earth Samba4 can't be installed from LuCI like Samba3.6 can, I cannot fathom (although I know why since the -libs dependency has shot up in size to 7.4MB for some reason...).
Then, to have to use the command line to add users and passwords is such a frustrating oversight to the LuCI-app.
So close and yet so far...
Great instructional video, though.
cannot mount... doesnt mount
have to mount via cmd line
tbh, i don't even know samba has reached version 4. 😌
LOL
@@VanTechCorner 😂
tôi đã mất 3 tiếng để làm được :))😀😀
where did you paste this line? "newuser:*:1000:65534:newuser:/var:/bin/false" You completely lost me at this point. which key is EXE and Column?
Hello, you better spend sometime to understand how to edit a text file with VI Editor using CLI.
Use ESC to switch to Command Mode
Use I to switch to Insert Mode
:wq to Write & Quit
www.cs.colostate.edu/helpdocs/vi.html
@@VanTechCorner I was using Putty and I'm an amateur with it too. I did get it working without a password. I have no classified documents on the drive so it's not too important to have a password.