I recently received a MacMini G4 and now to figure out what to do with it. I saw really cool video on how to use a macmini as a file server. In the video OS X was used but I wanted to do this on Linux. Two common ways to set up a file server are NFS and Samba.
This post will deal with setting up a file server using NFS on PowerPC.
Initial setup and network management
Besides the MacMini, I also got an external 1TB hard drive that I would be using as shared storage. I chose the 1TB drive mostly for testing. Right now it is fitting my needs, however in the future I do plan upgrading to a 4TB drive.
I installed Jessie on the mini with XFCE as the DE. I am going to run this headless, but I also wanted to be able to remote into the GUI. When I set my lxc containers I used vnc4server for remote access. Now I have found a better tool. Anyone who needs to have remote DE access to a server the tool I now recommend is xrdp. The is pretty easy, all you need to do is install the package,
apt-get install xrdp
The system takes care of the rest. Then all you need is an rdp client. The best one I have seen so far is remmina. Using it is pretty straight forward. The only gotcha I found was that you will need to define your screen resolution or it will not connect.
It is best if the macmini had a static ip in case dhcp give it a new address on reboot. So made a static reservation on my router.
NFS Install
Installing the NFS package is as simple as following,
apt-get install nfs-kernel-server
This will install package and needed dependencies. The system should start NFS upon install, but to verify this run these commands to see if you get the following results,
rican-linux@debian-minippc:~$ ps aux |grep smbd
root 8877 0.0 2.8 40012 14476 ? Ss Jul07 0:10 /usr/sbin/smbd -D
root 8878 0.0 1.5 40020 8028 ? S Jul07 0:01 /usr/sbin/smbd -D
root 15921 0.0 2.6 40332 13388 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15922 0.0 2.6 40332 13388 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15924 0.0 2.7 40484 14084 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15926 0.0 2.6 40528 13768 ? S 22:36 0:00 /usr/sbin/smbd -D
rican-l+ 15949 0.0 0.4 4564 2072 pts/0 S+ 22:43 0:00 grep smbd
rican-linux@debian-minippc:~$ ps aux |grep nmbd
root 8899 0.0 1.0 25728 5432 ? Ss Jul07 0:03 /usr/sbin/nmbd -D
rican-l+ 15952 0.0 0.4 4564 2180 pts/0 S+ 22:43 0:00 grep nmbd
root 8877 0.0 2.8 40012 14476 ? Ss Jul07 0:10 /usr/sbin/smbd -D
root 8878 0.0 1.5 40020 8028 ? S Jul07 0:01 /usr/sbin/smbd -D
root 15921 0.0 2.6 40332 13388 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15922 0.0 2.6 40332 13388 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15924 0.0 2.7 40484 14084 ? S 22:36 0:00 /usr/sbin/smbd -D
root 15926 0.0 2.6 40528 13768 ? S 22:36 0:00 /usr/sbin/smbd -D
rican-l+ 15949 0.0 0.4 4564 2072 pts/0 S+ 22:43 0:00 grep smbd
rican-linux@debian-minippc:~$ ps aux |grep nmbd
root 8899 0.0 1.0 25728 5432 ? Ss Jul07 0:03 /usr/sbin/nmbd -D
rican-l+ 15952 0.0 0.4 4564 2180 pts/0 S+ 22:43 0:00 grep nmbd
Once you have verified that NFS running, then you will need to edit the /etc/exports file in order to add the directories to share. You should have something like this below,
"/media/rican-linux/My Passport/" ip address(rw,sync,no_subtree_check,no_root_squash)
The first portion defines what directory you are sharing. Then you need define what machine you want to access your share. I have heard you can actually define by an entire subnet, but for some reason that did not work for me. So have a separate entry for each machine I want to access my share via NFS. The portion in parenthesis defines the permissions of the share. You can reference the exports man page for details. Then after you are done with the exports file, you need to reload it by running the following,
exportfs -ra
This should get you ready to set up the client side. This is done by installing the following package,
apt-get istall nfs-common
Once that is installed create a directory to serve as your mount point (I created one in my home directory for convenience). Then as root mount the drive,
mount ip address:path_to_drive mount_point
If successful you should see the following,
rican-linux@debian-ppc:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 71G 25G 43G 37% /
udev 10M 0 10M 0% /dev
tmpfs 404M 12M 393M 3% /run
tmpfs 1010M 72K 1010M 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1010M 0 1010M 0% /sys/fs/cgroup
tmpfs 202M 8.0K 202M 1% /run/user/1000
ip address:/media/rican-linux/My Passport 932G 1.6G 930G 1% /home/rican-linux/macmini-ppc
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 71G 25G 43G 37% /
udev 10M 0 10M 0% /dev
tmpfs 404M 12M 393M 3% /run
tmpfs 1010M 72K 1010M 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1010M 0 1010M 0% /sys/fs/cgroup
tmpfs 202M 8.0K 202M 1% /run/user/1000
ip address:/media/rican-linux/My Passport 932G 1.6G 930G 1% /home/rican-linux/macmini-ppc
If you wanted to make this permenant then update the fstab file. If you are wanting more information the Debian Wiki and the Linux Documentation Project sites are good resources to look at.