Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo for a basic NAS?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 943
Location: Belgium

PostPosted: Thu Jan 04, 2024 7:43 pm    Post subject: Gentoo for a basic NAS? Reply with quote

I have a NAS box here and it keeps giving me trouble. I have the box for several years now and never got it working. It was to start with a QNAP 453Pro after a colleague advised this because of his good experiences with it. I wanted a simple file server thing to regulary copy my files to and to make some of them available on other pc's in order to avoid shuffling usb sticks and disks between them. Also to make stuff like audio and photos shareable between family members (so also windows pc's).

But I really never got my head around the plethora of settings of that thing. A Qnap device comes with more types of servers that you can imagine, getting the ethernet bond up and running took ages and in the end I managed to get the disks visible to OR windows OR linux but never both at the same time.

So it stood years unused under the desk. Got new HDDs in it and put Truenas on it. This seems to work, but it always come to a halt after some time. Be it days or weeks, it just stops working. Doesn't respond on the network. I can reboot it, sometimes it works again for some time, sometimes not. I guess I can not have enough ram in it to keep it crashing.

Now I wonder if I could get Gentoo on it and run Gentoo as a NAS? After all this is nothing more then a (very basic) Celeron pc inside so it should be compatible. Using Gentoo would mean I use something I feel a bit more at home in. If something happens at least I'd be looking at a more familiar environment, getting support from this wonderful forum from people that know about the core of the system. I don't need much more then a windows and linux compatible fileserver. Principal use will be just another copy of our photos and documents. I do not need a webserver or ftp server running on it, or Mac compatability, or media uPnP server. There won't be a lot of users: 2 in total (me and my sister) so no complicated and frequent user management. There are 4 HDDs so something like software RAID5 would be great (but that should be possible on any linux). There won't be a nice graphical webinterface. But if I can do a remote X session over ssh and have LXDE that would be more then enough. Certainly if I don't need to use it more then once every year to check how the capacity is used.

Now would this be a "good idea" or would I miss some important features compared to a real NAS OS?

The only thing I can think of is power management. This will be on standby 99.9% of the time. So spinning the disks down when there is no request for days should be a minimum.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
rfx
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2023
Posts: 126
Location: de-by

PostPosted: Fri Jan 05, 2024 7:04 am    Post subject: Reply with quote

Thanks for your post, I've had the same thought for a long time. I use a QNap HS-453dx with 2x m2 + 2x sata SSD.
However, it seemed to me that it made more sense to sell the QNap at some point and buy a mini PC or something similar by installing the sata SSD and setting up gentoo on this new NAS. I also want more space so i need 4x sata, or stay with 2 and buy bigger.

It is also important to me to have a web interface to copy/delete data via app on my cell phone, nextcloud seems to be a solution for this.

But the whole thing will be pushed back for a few more months because my priorities are elsewhere at the moment.

A possible approach for Debian is described here: https://wiki.qnap.com/wiki/Debian_Installation_On_QNAP

I will put this threat on my watchlist and look forward to responses from other users
Back to top
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 812

PostPosted: Fri Jan 05, 2024 10:22 am    Post subject: Reply with quote

Basically a NAS is nothing more than a server specialized in storage, usually with NFS, SMB and friends, there is no reason you could not do this with Gentoo. My personal server has 2 drives in software raid and exports some storage via NFS, so you could call it a NAS.

I do have some thoughts about build-your-own-nas vs. off-the-self-nas i want to share:
- Be aware you'll have to build everything yourself. There are no fancy GUI's to guide or help you through the process. Think about Network, LVM, RAID, NFS, SMB, backups and maybe other components (depending on your opinion on GUI's this can be an advantage or disadvantage :-) )
- Be aware you'll have to fix things yourself in case something goes wrong. Are you comfortable fixing your LVM or RAID when something failed?
- Build-your-own usually offers most flexibility, it can do exactly what you want, you define the limits, but you'll have to do it yourself which usually takes more time/effort on your side

I'm not familiar with the hardware you are using, make sure it is supported by the kernels Gentoo provides (maybe you can test with a live image?). In case a hardware RAID controller is used double check the support on that.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Back to top
View user's profile Send private message
Ralphred
Guru
Guru


Joined: 31 Dec 2013
Posts: 501

PostPosted: Fri Jan 05, 2024 1:10 pm    Post subject: Reply with quote

pa4wdh wrote:
In case a hardware RAID controller is used double check the support on that.

I have a stash of "recovered servers" that I'm slowly working my way through, and have always shunned hardware raid, literally pulling the perc controllers when I can, and using the kernels software raid.

I think I've kind of turned the hardware/software paradigm upside down, and had the same gentoo OS running on multiple generations of hardware (with a few kernel & /etc tweaks), instead of having different iterations of software running on the same hardware. I've literally had two "server installs" in 20 years, one normal until about 2012, then built a new one with selinux that's been running since.

I dabbled with setting up a gentoo install as a "domain controller" outside of my regular "production area", and remember that it was very well integrated and I had no issues with windows machines finding shares or using the printer (attached to the server via usb and CUPS), so if I was looking to set up a machine for CIFS sharing that would be the guide I look to for the barebones samba setup for "smooth forward operation" (not necessarily doing the whole setup though).

NFS is obviously bulletproof in linux, but with regards to clients possibly being permanently connected I'm not sure how this would affect
Quote:
So spinning the disks down when there is no request for days should be a minimum.


I quick read of 'man LVM' makes me think you can set-up a MAID style storage area using linear thin provisioning, and possibly a cache disk (maybe unused area partitioned on a system SSD?) over the top of an set of offset mirrored MD arrays < Easy to replace disks and very resilient to data loss with spinning rust.

Quote:
Also to make stuff like audio and photos shareable between family members (so also windows pc's).

Anything beyond CIFS uploads, I'd use apache with an "upload area" (simple PHP script should do it). Any more complicated than that then https://www.humhub.com is a "requires reading to set-up" but simple to use mini social media site that can easily act like "a family facebook group" without the data slurping. There are probably other media sharing websites available to self host though, more suited to a archive style storage system.

Quote:
But if I can do a remote X session over ssh and have LXDE that would be more then enough. Certainly if I don't need to use it more then once every year to check how the capacity is used.
I'd use webmin for this, it's shunned by gentoo devs because of security flaws, but ebuilds are around, and the flaws are moot when only serving the inside of an ethernet, you could set-up a separate /30 subnet to run it of if you were really paranoid. If you set it up right it'll do LVM and MD management for you, configure many servers from BIND to samba, and keep an eye on disk usage, network usage etc - Or just serve as a "how much space is left" frontend. Despite its checkered CVE history I've never had issues with it and used it forever (on an intermnal intefrace!).
Back to top
View user's profile Send private message
rfx
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2023
Posts: 126
Location: de-by

PostPosted: Tue Jan 23, 2024 2:54 pm    Post subject: Reply with quote

I'm abusing this threat for my own purposes.

I would like to sell my current Qnap soon and run my current MiniPC with gentoo (basic without desktop manager) as a NAS. Setting it up isn't a problem so far.

But which software that is available for Gentoo would you recommend to me to make the PC NAS-compatible?

I would like to be able to shut down the PC using a mobile phone app and ideally also copy/unpack data (like with the QNAP Qfile and Qmanager). A web interface that offers the same would be nice, but not absolutely necessary to be able to use it on the PC.

To copy data, do I have Nextcloud in view and shut down via webmin? Or is there software that includes all of this in one package? Or would you trigger the shutdown via an SSH mobile app?

The switch wouldn't be necessary, but I'm looking forward to my first Gentoo NAS <3
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3138

PostPosted: Tue Jan 23, 2024 4:11 pm    Post subject: Reply with quote

What do you mean by "make the PC NAS-compatible" ?
NAS typically expose files over NFS and SMB, though there's nothing to stop you from throwing FTP, SFTP and HTTP into the mix or not throwing either of the most common options out.

NFS and SMB can both use filesystem level ACLs for permission management which is quite convenient for sharing group projects' documents between linux and windows clients. The other protocols may or may not be less admin or user friendly, but you should still pick whatever works for your use case. Even if it happens to be nextcloud.
Back to top
View user's profile Send private message
rfx
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2023
Posts: 126
Location: de-by

PostPosted: Tue Jan 23, 2024 6:27 pm    Post subject: Reply with quote

My wording was bad.

Yes, a working Gentoo, without display manager, raid, smb sharing. I can set that up, no problem.

What I'm missing is software with which I can copy and unpack files on the NAS, preferably via the handy app (Samsung). That's why I thought of nextcloud. but maybe there is better software that I don't know about? I would be grateful for your tips.
I want to control the files on the NAS from my smartphone. with my existing QNAP this is be done by the app QFile https://play.google.com/store/apps/details?id=com.qnap.qfile&hl=de&gl=US&pli=1

I think a shutdown command won't be the problem, if necessary I'll do it via ssh from my cell phone
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3138

PostPosted: Tue Jan 23, 2024 6:57 pm    Post subject: Reply with quote

It's good to know in what environment are you going to use that NAS. A few questions to help you design it:
Client: Windows / linux?
Access via: LAN / WAN?
Access control: How many people? Collaboration or segregation?


NFS and SMB allow you to just mount a network resource in a local directory, so it looks and can be used like a local device. You don't really need any special software for that; kernel does all the heavy lifting, so userspace doesn't have to know or care.

If you want to access it over the internet, you might use sftp subsystem of ssh and sshd. On linux you can even mount it via sshfs, and on windows you can use filezilla, winscp or many other clients. I'm sure you'll find a client for a smartphone as well. This approach trades performance and simplicity for security.

Remote shutdown is not really a part of a NAS, but ssh is the most linux way to do that. Still, it is your system, if some general rules get in your way, you can just break them (*cough* apache with sudo *cough*)
Back to top
View user's profile Send private message
rfx
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2023
Posts: 126
Location: de-by

PostPosted: Wed Jan 24, 2024 3:25 am    Post subject: Reply with quote

Thank you for your time and advice.

I do nothing special and do not need much functions. But the Fileclient on the NAS is very important for me.

I have one Laptop (Gentoo) at home and a Workstation (Gentoo) in my office. I can connect in the office in my VPN to my Router (Fritzbox 7590) at home, so i can access the NAS on a safe way ( I think) without giving it Access to the internet. The NAS has not to do much, it stores my files and has transmission running on it. I want to access to the Data from my Laptop, Workstation, Smartphone, this all is no Problem to configure.

But why i need your advice, i need a Fileclient on the NAS, that is usuable via Smartphoneapp (this is why i think on nextcloud), that i can copy and extract files local on the nas and it should be a direct copy on the nas. I do not want to do this via ftp, filezilla (e.g.) downloads the file to the smartphone and uploads it in the news folder what is not what i want. When i copy 4 files, everyone has 40-60 gb i would not be happy, even not in 5GHz WLAN
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3138

PostPosted: Wed Jan 24, 2024 11:49 am    Post subject: Reply with quote

Ok, I definitely don't understand what you want there. In the first part you're vaguely describing a pretty reasonable NAS, and in second part you up it to basically a personal google docs cloud for video editing.

What is the definition if a fileclient if filezilla does not qualify?
How is nextcloud "a direct copy on the NAS"?
What does a smarthone app have to do with quick access to big files?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum