Almost done !

Having issues with your DietPi installation, or, found a bug? Post it here.
User avatar
snoodler
Posts: 24
Joined: Sun Dec 01, 2019 1:30 pm

Almost done !

Post by snoodler »

Hi Forum,

I recently deleted raspbian on my Pi4 because dietpi seems a lot easier I installed next cloud, kodi and pi hole.

But I am stuck ... if you could please direct me to tutorials or a forum post would be great.

1 . I have an 8TB hard drive connected to the pi and followed a few tutorials but I still cant access the files inside my mac, I was able to do it with raspbian but i cant get it to work. the drives DONT auto mount , samba is installed but still wont work:

______________________________________________________________________________________________________________
PARTUUID=cb7b86f7-02 / ext4 noatime,lazytime 0 1
PARTUUID=cb7b86f7-01 /boot vfat noatime,lazytime 0 1
UUID=9de31ba8-b469-4f18-9c9b-46228e3b9802 /mnt/sg02 ext4 noatime,lazytime,nofail,x-systemd.automount
UUID=8436f92b-cb14-446f-96a2-02cf49ba0760 /mnt/sg03 ext4 noatime,lazytime,nofail,x-systemd.automount
UUID=f44393eb-22c4-4142-b10c-898c302ef8dd /mnt/sg04 ext4 noatime,lazytime,nofail,x-systemd.automount
UUID=b240602f-d071-45bf-b40b-731929bebe9a /mnt/sg01 ext4 noatime,lazytime,nofail,x-systemd.automount

______________________________________________________________________________________________________________
[global]

workgroup = WORKGROUP
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog only = no
syslog = 0

panic action = /usr/share/samba/panic-action %d

security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes

passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssu$
pam password change = yes
map to guest = bad user

load printers = no
printcap name = /dev/null
disable spoolss = yes

[dietpi]
comment = Pi Server
public = yes
writeable = yes
browsable = yes
path = /mnt/sg01
create mask = 0777
directory mask = 0777

______________________________________________________________________________________________________________

2. Properly setting up next cloud. I mapped an external drive and it shows with a green check mark, once i go the folder it wont show the files and it wont let me write on it.

3. If I dont turn on my monitor the pi4 wont let me ssh, I have my pi4 connected to my TV in the living room and would like to use it as a media server but will also like to access it through ssh. but if the TV is off it wont let me ssh. I have to go to the TV turn it on then I have to restart the pi4 in order for ssh to work.

Thanks a lot... sorry im a noob
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Almost done !

Post by MichaIng »

About SSH:
You need to reboot to have SSH access? Do you need to login from local console (TV) then? Actually any output and attached or not attached monitor should not have any effect. Please paste the following:

Code: Select all

journalctl -u dropbear # if you use Dropbear
journalctl -u ssh # if you use OpenSSH
About Samba:
You pasted a Samba server config, but how did you add the share to the Pi? Try dietpi-drive_manager in case, which automates the test to find the direct SMB version. Also AFAIK with newest version x-systemd.automount mount option needs to be added to the related fstab entry which AFAIK has been added for DietPi v6.27 but not yet v6.26. You can add it manually for now and see if it auto mounts then successfully on boot.

And for Nextcloud access, AFAIK the webserver requires permissions. When using dietpi-drive_manager, it will be mounted with 770 permissions and dietpi user and group. Hence usermod -aG dietpi www-data should do it. Else do the same with the group of your mount or use 777 mount mode (000 umask) permissions (not recommended for security reasons).
User avatar
snoodler
Posts: 24
Joined: Sun Dec 01, 2019 1:30 pm

Re: Almost done !

Post by snoodler »

Hi Micha,

Thanks for helping me out !

I got this for ssh:

-- Logs begin at Sun 2019-12-01 14:54:23 CET, end at Mon 2019-12-02 12:20:02 CET
. --
Dec 01 14:55:09 DietPi systemd[1]: Starting OpenBSD Secure Shell server...
Dec 01 14:55:09 DietPi sshd[868]: Server listening on 0.0.0.0 port 22.
Dec 01 14:55:09 DietPi sshd[868]: Server listening on :: port 22.
Dec 01 14:55:09 DietPi systemd[1]: Started OpenBSD Secure Shell server.
Dec 01 14:55:56 DietPi sshd[1438]: Accepted password for root from 192.168.2.101
port 53369 ssh2
Dec 01 14:55:56 DietPi sshd[1438]: pam_unix(sshd:session): session opened for us
er root by (uid=0)
Dec 02 12:19:46 DietPi sshd[10869]: Accepted password for root from 192.168.2.10
1 port 56495 ssh2
Dec 02 12:19:46 DietPi sshd[10869]: pam_unix(sshd:session): session opened for u
ser root by (uid=0)
root@DietPi:~#

Hope that means I dont have to turn on the TV anymore.

I did setup the drive with dietpi-drive_manager they do show up but appear unmounted. I know that doing mount -a will mount them all but I would prefer if they are mounted automatically when the pi reboots. dont understand where to put x-systemd.automount :( I learn by tutorials but always worry about how to do thing because I do tend to break things .. Im a noob,but learning.

I entered usermod -aG dietpi www-data but still cant see the files inside nextcloud.

Thanks !
User avatar
snoodler
Posts: 24
Joined: Sun Dec 01, 2019 1:30 pm

Re: Almost done !

Post by snoodler »

Just did a reboot with ssh and now :

ssh: connect to host 192.168.2.4 port 22: Host is down

PING 192.168.2.4 (192.168.2.4): 56 data bytes
ping: sendto: Host is down

I will have to go to the TV, turn it on and then restart the pi to make it work again.

I had it working with raspbian, I dont know how I did it though.
User avatar
snoodler
Posts: 24
Joined: Sun Dec 01, 2019 1:30 pm

Re: Almost done !

Post by snoodler »

Auto mount is working now.

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
PARTUUID=cb7b86f7-02 / ext4 noatime,lazytime 0 1
PARTUUID=cb7b86f7-01 /boot vfat noatime,lazytime 0 1
UUID=b240602f-d071-45bf-b40b-731929bebe9a /mnt/sg01 ext4 noatime,lazytime,nofail,x-systemd.automount
UUID=9de31ba8-b469-4f18-9c9b-46228e3b9802 /mnt/sg02 ext4 noatime,lazytime,nofail,x-systemd.automount
UUID=8436f92b-cb14-446f-96a2-02cf49ba0760 /mnt/sg03 ext4 noatime,lazytime,nofail,x-systemd.automount
UUID=f44393eb-22c4-4142-b10c-898c302ef8dd /mnt/sg04 ext4 noatime,lazytime,nofail,x-systemd.automount

Still cant share the drive with samba, every time I try connecting with my mac this shows up:

The operation can’t be completed because the original item for “dietpi” can’t be found.

I guess when I get that working nextcloud will work.. ?

I get this error when I try to setup samba with drive manager:

DietPi-Drive_Manager | File viewer ├────────────────────────────────────────┐
│ │
│ [FAILED] Samba mount failed with the following error output:

│ mount error(2): No such file or directory
│ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
│ mount error(2): No such file or directory
│ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
│ mount error(2): No such file or directory
│ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
│ mount error(2): No such file or directory
│ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
│ Retrying with upper case share name
│ mount error(6): No such device or address
│ Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Almost done !

Post by MichaIng »

Did you try to add a path to the samba mount? AFAIK you need to add <ip>/<share_name> only, while the path on server is given by the samba server options.

Very stage about Pi being down until TV is connected. Could you paste:
journalctl
It shows but and boot service logs with timestamps, hence you can track at what time e.g. network and/or SSH server has been reached/started. Would be interesting is for some reason something is delayed until you plug TV.

Okay about samba again, shall the Pi be the samba server or the Mac? dietpi-drive_manager allows to add external samba shares, hence the Pi is the client then. To make it the server, you need to install samba server, e.g. through dietpi-software, which creates a share for /mnt/dietpi_userdata/ automatically, accessible with user dietpi + global software password you assigned on first login, "dietpi" by default.
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: Almost done !

Post by Joulinar »

Stupid question regarding the RPi not being available as long as the TV is switched off. Does the RPi has it's own power supply or does it get power from an USB port on the TV?

Usually the RPi should work without anything connected except power and LAN/WLAN. It can be operated completely headless.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
snoodler
Posts: 24
Joined: Sun Dec 01, 2019 1:30 pm

Re: Almost done !

Post by snoodler »

I came back to this post because it keeps happening to me.

I just did a reboot and then had to go down to turn on the TV that is the only way I can get it to post.

I use the RPi as a cloud service and media player with kodi. so i do need to keep the hdmi cable connected.

The RPi has its own power supply.

journalctl is way too long so i had to post it here:

https://www.codepile.net/pile/pQxxodQx
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: Almost done !

Post by MichaIng »

inadyn[1168]: Network error while waiting for reply: Resource temporarily unavailable
This appears regularly. Not sure if there is a general connection issue of if inadyn somehow breaks local connectivity. To rule this out I would try to disable the daemon and check if SSH then works immediately after reboot.

Ay and now I see that No-IP is active as well:
Jan 22 12:43:47 DietPi systemd[1]: Starting No-IP update client (DietPi)...
Jan 22 12:43:47 DietPi noip2[1104]: v2.1.9 daemon started with NAT enabled
Jan 22 12:43:47 DietPi systemd[1]: Started No-IP update client (DietPi).
Two DNS clients or course does not make sense. Use either No-IP (if this is your DNS provider) or inadyn (generic?).
User avatar
snoodler
Posts: 24
Joined: Sun Dec 01, 2019 1:30 pm

Re: Almost done !

Post by snoodler »

I removed inadyn. still not posting till i turn on the TV
Post Reply