The MacMini G4 file server


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

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

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.

7 comments:

  1. Bookmarked. G4 Minis are great for this - very low electricity load.

    ReplyDelete
    Replies
    1. They can also make good desktops. Have you seen the video of Luigi Burdo running Ubuntu-MATE on his MINI?

      Delete
    2. A G4 Mini would idle around 40-50 watts, but even at max load it only uses 110; half what a late G3 to early G4 tower would use.

      The PowerPC Mini's also seem to have very good longevity - outliving many of their newer Intel counterparts. Mark (fiftysixk) donated a G4 1.25 Mini to me a while back, which I use as a headless server running Leopard and OpenBSD.

      Delete
  2. At home, I use a MacMini G4 as a server so I feel very concerned by the topic!
    About consumption, I will rather say that it consumes ~40 W at a maximum (compiling Linux kernel) and 20-25 W in idle with wifi, bluetooth, ... I investigated that in the past, you can find some results here:
    https://code.google.com/p/powerpc-lab/wiki/board_macmini

    Note that I will close these website pages and then I will share my work on PPC elsewhere.

    The MacMini is a great machine! I am only disappointed by the impossible frequency scaling (as far as I know).

    ReplyDelete
    Replies
    1. A 7447a (the chip used in the G4 mini's) at max load would use 34+ watts by itself. Possibly even push 40.

      The main point of the 7448 chip that followed was to lower the power consumption at least 50% because the 7447 was a bit of a power hog. A 1.7GHz 7448 is officially rated to consume 18 watts at max use.

      Other than the memory slot, a G4 mini is essentially a headless laptop, so like a G4 laptop of this era it would use at least 50-60 watts at full resource consumption.

      So I guess to use the full 110 watts the mini power brick has, you would have to have a few external USB or FW powered devices.

      Delete
    2. Also, I forgot to mention that the 7447 is a 130nm chip, so that in itself puts it above your numbers.

      The super efficient chips are 90nm and smaller, like the 7448.

      Delete
  3. I am using a dual 400 GE for the task of file and music server, but I wonder if a single 400 Mhz sawtooth or a 733 QS would be more power consumption friendly.
    I know that 7447 chips and above are more efficient but I have some doubts about the older machines.

    ReplyDelete