Windows 10 isn't seeing DietPi...

…and I don’t know where to change settings or troubleshoot.

I’d like to get back to using DietPi as a NAS, but I’m lost as to where to go.

I can SSH into the Pi as well as ping it from my Windows 10 laptop, but when I attempt to “Map network drive,” I can’t log onto the Pi like I used to be able to. When I put the folder to “\192.168.1.134\DietPi” I get a request for a username and password. When I enter them, I get asked for the password a second time and then the error “The drive could not be mapped because no network was found;” this is even when I check the box to “Connect using different credentials.”

Netstat -l shows that port 139 in the Pi is not set to “Listening,” and I don’t know how to open it up or if that’s even the problem.

Where do I go from here?

Hi,

you have installed samba? And did you checked if the samba services are running?

Thanks for taking the time to get back with me!

I installed Samba Server through dietpi-software and rebooted. This should start the Samba going, right?

whereis samba produces:

/usr/sbin/samba /usr/lib/arm-linux-gnueabihf/samba /etc/samba /usr/share/samba /usr/share/man/man8/samba.8.gz /usr/share/man/man7/samba.7.gz

I can edit (although have not yet) smb.conf, so it’s at least there.

I forgot to mention before that when I try to Telnet into the Pi, Window’s CMD window either just produces a blinking cursor on a blank screen for up to 30 minutes before I close it or tells me that it “Cannot open a connection to the host on port XXX: Connect fail.”

I forgot to mention before that when I try to Telnet into the Pi,

Telnet is not active on DietPi. You would need to use SSH

let’s check if samba is running as well

ss -tulpn | grep LISTEN
systemctl status smbd nmbd

Sometimes Windows is keeping a share connected within the background, blocking a new connection. Let’s check following on your Windows box

net use

Alright, thank you again for your help; I know you guys have better things to do than help strangers out with things they should be able to figure out on their own.

Moving on:

ss -tulpn | grep LISTEN produces

:

root@DietPi:~# ss -tulpn | grep LISTEN
tcp     LISTEN   0        50               0.0.0.0:445           0.0.0.0:*                                                                                               users:(("smbd",pid=3634,fd=31))
tcp     LISTEN   0        5              127.0.0.1:4711          0.0.0.0:*                                                                                               users:(("pihole-FTL",pid=558,fd=13))
tcp     LISTEN   0        50               0.0.0.0:139           0.0.0.0:*                                                                                               users:(("smbd",pid=3634,fd=32))
tcp     LISTEN   0        1024             0.0.0.0:80            0.0.0.0:*                                                                                               users:(("lighttpd",pid=567,fd=4))
tcp     LISTEN   0        32               0.0.0.0:53            0.0.0.0:*                                                                                               users:(("pihole-FTL",pid=558,fd=5))
tcp     LISTEN   0        128              0.0.0.0:22            0.0.0.0:*                                                                                               users:(("sshd",pid=628,fd=3))
tcp     LISTEN   0        50                  [::]:445              [::]:*                                                                                               users:(("smbd",pid=3634,fd=29))
tcp     LISTEN   0        5                  [::1]:4711             [::]:*                                                                                               users:(("pihole-FTL",pid=558,fd=11))
tcp     LISTEN   0        50                  [::]:139              [::]:*                                                                                               users:(("smbd",pid=3634,fd=30))
tcp     LISTEN   0        1024                [::]:80               [::]:*                                                                                               users:(("lighttpd",pid=567,fd=5)) 

tcp     LISTEN   0        32                  [::]:53               [::]:*                                                                                               users:(("pihole-FTL",pid=558,fd=7))
tcp     LISTEN   0        128                 [::]:22               [::]:*                                                                                               users:(("sshd",pid=628,fd=4))

systemctl

● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; disabled; vendor preset: en
abled)
   Active: active (running) since Sun 2021-05-23 16:03:39 BST; 1 day
9h ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 3633 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (cod
e=exited, status=0/SUCCESS)
 Main PID: 3634 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 3 (limit: 4915)
   CGroup: /system.slice/smbd.service
           ├─3634 /usr/sbin/smbd --foreground --no-process-group
           ├─3637 /usr/sbin/smbd --foreground --no-process-group
           └─3638 /usr/sbin/smbd --foreground --no-process-group

May 23 16:03:39 DietPi systemd[1]: Starting Samba SMB Daemon...
May 23 16:03:39 DietPi systemd[1]: Started Samba SMB Daemon.
May 23 21:44:14 DietPi smbd[27871]: pam_unix(samba:session): session closed for
user nobody
May 24 22:46:28 DietPi smbd[13293]: pam_unix(samba:session): session closed for
user nobody

● smbd.service - Samba SMB Daemon
   Loaded: loaded (/lib/systemd/system/smbd.service; disabled; vendor preset: en
abled)
   Active: active (running) since Sun 2021-05-23 16:03:39 BST; 1 day
9h ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 3633 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (cod
e=exited, status=0/SUCCESS)
 Main PID: 3634 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 3 (limit: 4915)
   CGroup: /system.slice/smbd.service
           ├─3634 /usr/sbin/smbd --foreground --no-process-group
           ├─3637 /usr/sbin/smbd --foreground --no-process-group
           └─3638 /usr/sbin/smbd --foreground --no-process-group

May 23 16:03:39 DietPi systemd[1]: Starting Samba SMB Daemon...
May 23 16:03:39 DietPi systemd[1]: Started Samba SMB Daemon.
May 23 21:44:14 DietPi smbd[27871]: pam_unix(samba:session): session closed for
user nobody
May 24 22:46:28 DietPi smbd[13293]: pam_unix(samba:session): session closed for
user nobody

Finally, it looks like Windows is the issue.

Netuse reveals

“System error 1222 has occurred. The network is not present or not started.”

I’m going to go do some searching to see what I can find about this and wait for a reply here in the mean time

I found this very old blog entry. Maybe it’s still valid.

http://sgdumb.blogspot.com/2010/08/system-error-1222-network-is-not.html

It’s different than what I’d found by the time I saw this reply and is leading down a rabbit hole that may take me a while to figure out, but it feels like momentum is building.

Thank you!

let us know if you find something on your Windows box :slight_smile:

Well, I don’t know if it was the right thing to do, but after banging my head on the wall, I finally got NET USE to indicate “New connections will be remembered. There are no entries in this list.”

I did this by enabling SMB 1 in Windows 10 and I’m now back to where I was when I started this thread: I can SSH and ping my Pi but can not find it by trying to map a network drive.

Thanks again for the help!

did you tried to connect from a different device? Like your mobile phone? There are quite some apps who support SMB

I didn’t know those apps existed.

I installed Astro File Manager for Android and tried to gain access to the Pi and no joy there either. I get an “Access denied,” with that, even after double checking my password.

We lost power the other day and my Pi was corrupted. I’m now working with a shiny new install, and when I map the network drive (I don’t actually yet have the drive hooked up, I’m just trying to log in anywhere before moving on) the error I now get is “Access denied,” with my Windows box, which seems like a step forward.

I can also see the Pi in the map network drive window, when I enter it’s IP and click on “Browse.” Beneath is is listed “Diet Pi,” so there is progress being made, as that was not the case before; there was nothing there when I tried this before.

I double checked the password I’m using by logging in as Root locally to the Pi and logging in via SSH.

Should I have needed to turn on SMB1 package in Windows to get this far? I think I missed what version of SMB DietPi uses.

Back when I had DietPi working a few years ago, I never played around with SMB1 settings to get things working, but I also know at some point MS shut it down with an update.

The user to login is user dietpi and not user root

Well, I feel pretty silly about that. She works now.

Be that as it may, I got different results before I re-flashed the image yesterday after the blackout. Before that, even though I may have been using the wrong username, I was getting errors not related to that. The errors were not “Access denied,” so I’m confident that, while the username was wrong, it wasn’t the problem. It happened with different OSs’ too.

Would that have been because SMB1 was off on my Windows laptop? Do I NEED SMB1 to be turned on? I’m about to go start playing around with this to see for myself, but I’ll likely get faster answers here. A few weeks ago, I turned SMB1 back on and didn’t have the progress I made tonight, so I believe there was some issue that I’ve solved that I don’t even know about.

This situation also happened with various OS I used on my Pi, including Raspbian, RPIOS and Debian.

Is it common for images to be corrupted as they flash and maybe I was having that issue in the recent past?

After a fresh flash of an OS (DietPi or otherwise), is there a way I can verify the integrity of the image to be sure that every aspect of the OS is working properly?

Am in the right forum to be asking what kinda seem to be general Linux questions?

Thank you for all of your time that you’ve invested in this.

usually there is no need to enable SMB1 on Windows as the SAMBA version installed supports v2 and 3.

Yes SD cards have a risk for data corruption and physical damage. This depends on the usage and how many data are written down. The more you writing down (like using a download client), the more risk you have. Better to use a SSD, if you operate something like NextCloud or a torrent client. In your case, you like to use it as NAS. Probably you should rethink the usage of SD card. But yeah it depends on your device if it supports mass storage boot. Personally I use a small USB stick, instead of SD card, on my RPi3B+ and 4B.

I just disabled SMB1 again and now can no longer access the Pi; should I start another thread to deal with that or keep on going here?

The error is now: “The local device name is already in use. This connection has not been restored.”

Mapping the network drive is the same result I started this thread with, it’ll ask for my password twice, then say that the path cannot be found.

I did a little playing around and, consistently, with SMB1 turned off I’m unable to see the Pi from Windows.

Through some experimenting I wound up partially enabling SMB1 by just enabling the client support and we’re golden again, but I don’t know if that still leaves the network vulnerabilities that SMB1 enables.

what does net use shows to you?

With SMB 1.0/CIFS Client enabled, I get a successful command and the Pi shows up along with the IP address.

With SMB 1 disabled (This is the ideal situation for security, correct?) I get “System error 1222 has occurred. The network is not present or not started,” right back to where I was at the start of the thread.

I can’t remember if I mentioned but I’ve tried turning on and off SMB1 for weeks before starting this thread with several different variations of Linux, including Diet Pi, Raspbian, RPI OS and Ubuntu as well as some others I can’t quite remember. After the fresh install of DietPi the other day, things changed and I don’t really know why.

I have disabled SMB1 and I don’t have such issues. For me it looks quite strange that net use is not working as soon as you disable SMB1. Probably something to ask on a Windows specialized board.

It is a Raspberry Pi Buster system, right?

If DietPi is based on Buster, then yes. A RPI 4.

Thank you for your time as well!