NextcloudPi self-hosting: beginner questions on storage operation

Hello!

Tl;dr: I’m looking for basic info on how to safely operate (unmount / view folder structure) my storage on a NextcloudPi without a screen, and I am a total beginner in operating the TUI / terminal commands in general, that are most likely just assumed knowledge for most.

I settled upon self-hosting a Nextcloud instance on a Raspberry Pi 4 as a challenge / learning experience when I began distancing myself from Google services.

I powered the Pi up, connected a 2TB storage via USB3, a 32gb MicroSD card and plugged it into my router via an Ethernet cable and got to work.

I was able to get everything up and running with a few failures, but I started over again whenever I hit a wall, and eventually all the check-marks in the installation wizard passed through. I had the USB drive apparently formatted and operational, as I am able to upload and download files, and access them from an external network via browser / mobile.

Now that my instance was operational I ran through the WUI’s parameters to understand what I could, enabling SSH and UFW and checking security with the available services like “nc-audit”.

I even ventured preliminarily into the TUI at one point and was able to conjure a large nextcloud logo, log in and run an update and some basic commands that were available (and understandable by me) in the NextcloudPi Configuration Documentation.

So, after this lengthy but hopefully useful intro, I’m at a bit of a loss at how to conduct some basic operations that I would like to know how to do, but the WUI doesn’t seem to allow me to easily do.

  1. How do I view my folder structure (directory tree?) in the TUI?

I would like to be able to see basic stuff like the drives attached and folders underneath them to get a bit of a better feel for how the data / OS / etc. are distributed over the microSD and 2TB storage (+ other future drives), and how the Pi actually operates.

  1. How do I safely unmount/halt drives?

Under the option “nc-automount” in the WUI, there is a warning: “IMPORTANT: halt or umount the drive before removing”, without any direction on how to actually do that? After browsing I was still at a loss, and assumed that it would have to do with executing a command from the TUI? But even after opening the “help” page in Terminal I wasn’t able to find something I would be confident or capable of operating to safely remove my drive.

Thank you for reading.

tree 

if not yet installed

sudo apt install tree
df -h
mount
du -h --max-depth=1 /
du -h --max-depth=2 /
du -h --max-depth=1 /home
....

or

sudo apt install mc

mc

but don’t get caught. linux pros won’t talk to you anymore if you tell them you are using mc.

umount /path/to/device
# or
umount /path/to/mountpoint
# see mount

better: poweroff
umount might not work if nc is still running or funny thing may happens. but you don’t want them to happen. :wink:

1 Like

Big thanks for you quick and on-point answer, exactly what I was looking for! :slightly_smiling_face:

They should add this info straight to the NextcloudPi config page, gave me a much better feel for what I am managing here and these feel like necessities in understanding one’s system.

better: poweroff

You mean poweroff is a more favorable option for unmounting stuff? I assume this turns off the whole Raspberry, and just by replugging the power in everything should start up without further configuration / procedures?

With poweroff I get

Failed to set wall message, ignoring: Interactive authentication required.
Failed to power off system via logind: Interactive authentication required.
Failed to open initctl fifo: Permission denied
Failed to talk to init daemon.

And with umount /media/myCloudDrive I get

Error finding object for block device 0:39

If something stands out s glaringly simple that’d be a great help, but I’ll keep on trucking to figure it out!

EDIT: I just added sudo poweroff instead of poweroff and received

Connection to “my IP” closed by remote host.

Might be a bit of a basic mistake but I’ll leave it up for posterity for others like me!

But thanks again for the info, and i’ll be sure to keep mc close to my chest for now :wink:

if you get something with permission denied try sudo !!
(!! is your last command. :wink: )

and yeah. it’s sudo umount ...

if you have 1000 users on your machine: no.
since you are new to linux and - i assume - you are the only user: yes.

if you umount a device any service writing to that device will crash or (worse) will write to the mountpoint directory. that is to say /media/myClouddrive points either to your hdd if mounted or to your ssd if not mounted. your app doesn’t care. (ok. nextcloud cares. you’ll get i file not found.) but think about an app writing a log file. another problem: after you remount your device you won’t see the files in the mountpoint directory anymore. and you will wonder why there is no space left on your ssd device. hope you got the point that it can be complicate.

btw: i’m not talking about e.g. usb sticks/sd cards you plugin to copy content via cp ... . you can handle this like with your windows laptop. :wink:

1 Like

Very helpful, thank you!

Yeah I’m running this on my own and for myself, so I’ll stick to the simple poweroff for now as I go along.

Happy to hear that nextcloud has some safeguards in place, but definitely interesting to hear why something might be an issue, will definitely try and fully wrap my head around this and return to it a few times :slight_smile:

Thanks!