Stuck setting up a local file server

Hello

I’m George, geo for short. A friend of mine recommended I try using Fedora Server 35 to make a home file server. I asked him whether I should use Windows server for home use but recommended Fedora.

I’m presently using a Ubuntu setup as a file server running on a USFF Dell Optiplex 990 with a single 2TB hard drive. My friend recommended Fedora over Ubuntu. The Optiplex is connected via an Ethernet cable and it is connected to a UPS. The Optiplex is placed up on a shelf out of the way with no monitor, keyboard or mouse so I can use Remote Desktop Connection on my Windows 7 PC to login and administer the Optiplex.

Please bear in mind that I’m not a computer professional and I despise command line stuff in Linux because I don’t know and don’t understand most of the commands, I don’t work in computers for a living.

I have downloaded the Fedora Server installer onto a DVD and I have installed Fedora 35 on the Optiplex with the single 2TB HD. I partitioned the hard drive during the install process to have a Home directory with about 1.77TB free space and this is where I want to store network accessible files (photos, movies, music, etc…). I want to create 4 directories, each one with a password protection.

When I go on Chrome on my Windows 7 PC and login with the IP address (because typing https://fedora:9090 doesn’t work for me), I get to the login window and I can login successfully with the administrator name and password I set up with adminstrator privileges.

I want to set up the 4 password protected directories and begin to copy files from the Ubuntu Server to Fedora Server via the home network. I’m guessing I have to go to NFS because I think that means Network File Service. But I can’t get Fedora to use the 1.77TB free space on the single HD.

When I click on New NFS Mount I’m presented with a popup box which wants me to fill in 3 empty boxes:

Server address
Path on Server
Local Mount Point

I’ve tried fiddling with these values (I plan on running this on a local IP address 192.168.50.56 ) and for mount point and path I specify /dev/sda and I get the error message:

mount.nfs: mount point /dev/sda is not a directory

What does it want me to type in? I don’t understand what it wants.

It took me ages to set things up under Ubuntu (several weeks of struggling, stumbling, screwing up, wiping out and retrying over and over from scratch) and it finally works but I find that software updates are still awkward and seem to still need command line stuff to make things behave.

Is there some kind of beginner user guide which I can refer to? Help!

geo

1 Like

I propose you to install sudo dnf install cockpit on your server, so you can access it with a web-browser.

What does that command do? Please explain?

sudo dnf info cockpit

The Optiplex says cockpit is already installed.

How can I set it up to use the single internal HD partition to permit password protected file serving within my home, not outside of my home?

@ilikelinux I think from the description that @georger is already using Cockpit. George, you’re using a web interface that looks like this, right?

Your description sounds exactly like what I’d expect to see when launching Fedora Server in an VM, including the detail about https://fedora:9090 being suggested but not working. (That’s probably a bug for the Fedora Server team to work on!)

Anyway, next things… can you show us how the storage is set up? A screenshot of the “Storage” tab in Cockpit should do it.

Some basic concepts here in the meantime. First…a diskpartition crash course (hopefully with no actual crashing!)

In Unix/Linux, everything is represented as a file in the file tree, including devices — so you see /dev/sda, which is basically raw access to a hard drive. (On my cockpit VM, it’s /dev/vda, because it’s a virtual drive, but the same concept applies.)

That raw access isn’t what you use directly, however. Instead, you mount disk devices somewhere. And, and actually, except occassionally for USB flash drives, we usually divide those up into partitions … and then there’s a whole bunch of complication from there. But cockpit, fortunately, makes it pretty easy. (I’ll show that in a bit.) The key thing here is that instead of sharing a device file like /dev/sda, you’ll share somewhere in your filesystem structure, like /srv/nfs. That can either be just a subdirectory on your / volume, or it can be the mount point for another device.

Because it’s a server operating system, Fedora Server’s default config introduces an additional complication, Logical Volumes (and volume groups). These are … like partitions cranked up to the next level. On my new Fedora Server VM in cockpit, I see this in the storage pane:

So I have two mounted filesystems. One is /boot, mounted directly on the first partition on /dev/vda — that’s /dev/vda1. This is a small (1GB) filesystem that hold essential boot files. So I’m not going to mess with it. I see that / — the “filesystem root” is mounted at /dev/fedora_fedora/root. And that’s all. That means everything else on this server, currently, is on that device. (/home, /srv, /usr, everything.) I’m going to click on that one and see what I get:

See the the button to grow the volume (and see in the little box over to the right that I have 4GB free). The filesystem used by default is professional-grade XFS, which can grow but not shrink. This is one reason the default configuration doesn’t use your whole disk. But in any case, what we’d want to do right now is, instead, Create new logical volume.

Now I’ve got:

and the next thing is to hit the “format” button, giving me:

Here, I’ve given the name nfs-share, and chosen /srv/nfs as the mount point. The /srv directory is designated for things like this — you should use that instead of /home or /usr or some made-up name.

And now, if we go back to that first storage pane, there it is!

More later… does all this make sense so far?

And here’s the next thing: these options are for consuming an NFS share from an existing network device. It’s asking the address of that device, the remote share name, and where you want to mount it locally. (Part of the magic of NFS is that once it’s mounted locally on this machine, it looks almost identical to any local drive.)

Now… a confession here. I personally have never set up an NFS (or Samba) server with cockpit. But I’m sure someone around here has. Hopefully this at least gets you a little further along!

Has this doubt been answered? The type of share you choose depends a lot on your clients. Types can be: NFS, SAMBA, WEBDAV, SFTP, SCP, …

For example, if your Clients are Linux clients, NFS is great, but if your Clients are running Windows, samba would be the better choice, and so on…

2 Likes

Hello @georger ,
Welcome to ask :fedora: !
You may want to check out the related Fedora Magazine articles about Cockpit! I think it is relevant to your question, and may help get you started.

1 Like

I don’t see how to get to “Logical volumes” from where I am. It just isn’t there.

I’ve taken a screenshot of what things look like on the set up I have here, please examine it and advise me on what is missing and how I can possibly remedy it.

1 Like

My client is only myself and a couple of family members. This is a home application of a file server for movies, photos, music, etc… and I want password protection on each directory.

As long as every family member‘s client speak that protocol…

Funny :slight_smile: clients = computers with different OS, server = Fedora-Server

Okay, it looks like your system may be set up differently – perhaps you didn’t choose the default partiion, or maybe you didn’t start with Fedora Server install image. That’s okay, just different. Thanks for the screenshot.

Can you click on the /home partition there for details? I think what we might want to do is shrink that — which will be possible if it’s not XFS. (If it lets you, I’d suggest shrinking it down to 100gb or so. Then we’ll take the next steps from there!)

(And: those next steps are going to take us to the command line, I’m afraid. Which will be less scary than it sounds.)

I’d really rather not shrink it because the whole partition space is going to be used. Movies take a lot of room on a hard drive.

When I click on that drive I’m taken to another window which shows the partitions. At the bottom is the main big partition I wish to use.

Towards the right are 3 vertical dots which when I click on that I’m offered a choice to Unmount, Format or Delete. The drive space there is empty, I haven’t put anything on it yet because I’m not at a point where I can even see this server on my local network (Network browser in Windows 7).

If this ends up being too complex, too much like a lab experiment, my alternative was to bite the costly bullet and get a Mac mini. Apparently those make good file servers and it’s all a graphical interface. So I hope I can be assisted here so I can avoid that possible expense.

When he suggested shrink he was meaning to shrink the portion of the drive (partition) containing the OS so there would be space available to create a new partition for the shared media.

With having only one partition that contains everything it makes it difficult to properly segregate and backup what you consider important to save. Also it means difficulty later down the road if you decide to do a reinstall of the OS since that would mean the necessity to wipe out everything in that partition. Having your data in a separate partition simplifies that scenario drastically.

2 Likes

Oh! Well I did that during installation.

There’s a 2 meg partition for boot, a 40 Gig partition for the operating system, 8 Gig swap partition and everything else is set to be /Home partition. I believe it is set to be XFS.

It’s just trying to get this partition to go online as Samba (because between Mac and PC computers that come and go as well as iPads I know I can make everything work off of Samba.)

What I’m looking for here is the filesystem type (probably one of xfs, ext4, or btrfs) in use for that partition.

But I also notice something that concerns me — but might actually be convenient for what we need to do. I see that the mount point is /Home, with a capital H. In Linux, filenames are case-sensitive, so this is different from the standard /home mount point. Can you do me a favor (this will answer both of my questions!) and switch to the Terminal pane (bottom of the list) and type df and hit enter? On my test VM, I see:

root@fedora ~]# df
Filesystem                           1K-blocks    Used Available Use% Mounted on
devtmpfs                                985200       0    985200   0% /dev
tmpfs                                  1006492       0   1006492   0% /dev/shm
tmpfs                                   402600    1068    401532   1% /run
/dev/mapper/fedora_fedora-root        15718400 1835724  13882676  12% /
tmpfs                                  1006496       4   1006492   1% /tmp
/dev/vda1                              1038336  199968    838368  20% /boot
tmpfs                                   201296       0    201296   0% /run/user/0
/dev/mapper/fedora_fedora-nfs--share   4179968   62204   4117764   2% /srv/nfs
[root@fedora ~]# 

You should be able to right-click and copy that as text and paste it here.

Then, can you also show df /home /Home (lower-case h first, followed by upper-case H, on the same line)? I suspect that this will tell us that /home is actually a directory on / and /Home is your separate filesystem. But I don’t want to confuse things if my assumption isn’t right.

I’m confident we can get you going, although I don’t think it’s going to be an all-graphic-interface experience. There isn’t, apparently, a good file serving configuration tool for Cockpit at this point, so we’re going to have to do it the old-fashioned way. But trust me… it’s not as scary as it sounds.

I think, also, that you probably want to use Samba rather than NFS. You’re right that NFS means “Network File Service”, but it’s a service that’s designed for and optimized for Unix/Linux client systems (as others have said, this means "client’ in the sense of “client-server”, not “client-as-customer”). If your other systems are Mac or Windows, Samba is going to be easier, because it creates Windows-style filesystem shares. But we’ll get there in the next steps. :slight_smile: