Network access usb drive(without transfering user data) Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
acostas
Posts: 7
Joined: Thu Mar 21, 2019 12:09 pm

Network access usb drive(without transfering user data)

Post by acostas »

Hey guys.

Sorry i am not an expert, and all I need is to network access a usb drive that I have mounted on my Pi.
At first I mounted my drive and transferred there the user data and all worked well and had read/write access from my network pc and mobile.
When i removed the drive i couldn't access my pi after root login.
So I transferred back to default the dietpi_userdata.

All i need is to have network access in /mnt/399D0A4803AD3A26 folder (I already have in /mnt/user_data)

ps: I hope all i said makes sense.
ps2: I dont want an own/nextcloud solution. I have worked with that and i prefer something simple.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: Network access usb drive(without transfering user data)

Post by MichaIng »

First jep, the dietpi_userdata need to stay attached to the system since some software titles and e.g. MariaDB database files and such are stored there, so this is required to have all services started. But besides some failing services, the system should start fine, allow login and all such, or what do you mean by:
When i removed the drive i couldn't access my pi after root login.
?

How did you enable network access to the userdata at first, Samba or NFS or another protocol? In any case you can define the path that is shared. By default this is /mnt/dietpi_userdata indeed, AFAIK. If it should be another or additional one, please tell me which network share server you use and we will find the config/setting that needs to be adjusted.
acostas
Posts: 7
Joined: Thu Mar 21, 2019 12:09 pm

Re: Network access usb drive(without transfering user data)

Post by acostas »

At first I installed Samba from dietpi-software and from dietpi-drive_manager I mounted the usb drive.
From a tutorial they pointed to use User Data Location so I changed it to my usb drive at /mnt/399D0A4803AD3A26

All worked but when i did some tests and unplugged the drive something happened. I could login with terminal but nothing went past the login and couldn't type anything. The screen was showing only what u see in img below:
Image

So i pluggedin the drive and change user data back to /mnt/dietpi_userdata
I guess I am back to normality with that.
Image

My usb drive is still mounted at /mnt/399D0A4803AD3A26 and this is where i want to access from my network.
Thank you in advance.

ps: I use lighttpd for pi-hole and I also run openvpn


************* EDIT / Solution **************

Oh it was way too easier than I thought:
-service samba stop
-nano /etc/samba/smb.conf
-I changed "path = /mnt/dietpi_userdata" to "path = /mnt/399D0A4803AD3A26"
-systemctl restart smbd nmbd
- Checked network drives. and boom! here it is:D
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: Network access usb drive(without transfering user data)

Post by MichaIng »

Great, jep that's the way to change the Samba share directory.

I have an idea why login files with external drive detached:
https://github.com/MichaIng/DietPi/blob ... in#L56-L66

The login script waits for "DietPi-Postboot" to finish. This again starts all DietPi-controlled services. If one of these services hang, because it cannot find it's data (on the userdata drive) then it waits for up to 15 seconds.
But after 15 seconds the login prompt should show up and you can force it to cancel via <crtl>+<c>.
Post Reply