on
Resurecting Iomega Home Media Network Hard Drive
I have in my lap a broken Iomega Home Media Network Hard Drive. Well, what is broken is the HDD. The rest of the system is in perfect order, so I planned to revive this NAS in order to cut down on the e-waste.
Installing Default OS
The original OS image is no longer hosted online, but thanks to archive.org, you can download mbr+uboot+kernel.gz and sda1-2064.tgz here.
Attach the HDD that will go into the NAS and find out its name using lsblk. In my case, it was sda, so this is what I will be using in this tutorial.
Write mbr+uboot+kernel.gz to disk
gzip -dc /full/path/to/mbr+uboot+kernel.gz | sudo dd of=/dev/sda
Change the second partition size (data)
If you check the sda2 at the moment, you will see that the size is all wrong.
Device Boot Start End Sectors Size Id Type
/dev/sda1 48195 8273474 8225280 3,9G fd Linux raid autodetect
/dev/sda2 8273475 963899999 955626525 455,7G fd Linux raid autodetect
/dev/sda3 1 48194 48194 23,5M da Non-FS data
I am using a less than 100G HDD, but my second partition is 455,7G, we will need to fix this. Just delete the partition and recreate it as a primary partition with type fd. In this example, we are going to use fdisk:
sudo fdisk /dev/sda
Here is a summary of the command you will need:
- Delete partition: d -> 2
- Recreate partition: n -> p -> 2 -> (just press enter to agree to default) -> just press enter to agree to default)
- Change type of partition 2 to
fd: t -> 2-> fd - Save and exit: w
Format partition 1:
sudo mke2fs -j /dev/sda1
Create a mountpoint, and mount partition 1:
mkdir /tmp/sda1
sudo mount /dev/sda1 /tmp/sda1
Install the rootfs:
cd /tmp/sda1
sudo tar -xzf /full/path/to/sda1-2064.tgz
Format partition 2:
sudo mkfs -t xfs /dev/sda2
- You might need to adjust the block size with the -b parameter (512:4096)
The box is now working. You can just plug it in and use it as you have before. But it would be more interesting if we could play around with it a little bit more. Do understand, every further step makes the device highly insecure.
Enable remote login
Let’s enable telnet.
Remember, we are currently in the /tmp/sda1 folder.
Edit etc/inetd.conf and uncomment telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd
Then we will need to create the init.d script. This is where Linux from Scratch comes to the rescue:
-
Create
etc/init.d/inetdwith!/bin/sh # Begin /etc/init.d/inetd check_status() { if [ $? = 0 ] then echo "OK" else echo "FAILED" fi } case "$1" in start) echo -n "Starting Internet Server daemon..." start-stop-daemon -S -q -o -x /usr/sbin/inetd check_status ;; stop) echo -n "Stopping Internet Server daemon..." start-stop-daemon -K -q -o -p /var/run/inetd.pid check_status ;; reload) echo -n "Reloading Internet Server configuration file..." start-stop-daemon -K -q -s 1 -p /var/run/inetd.pid check_status ;; restart) echo -n "Stopping Internet Server daemon..." start-stop-daemon -K -q -o -p /var/run/inetd.pid check_status sleep 1 echo -n "Starting Internet Server daemon..." start-stop-daemon -S -q -o -x /usr/sbin/inetd check_status ;; *) echo "Usage: $0 {start|stop|reload|restart}" ;; esac -
Set up permissions and symlinks
sudo chmod 755 etc/init.d/inetd cd etc/rc2.d sudo ln -s ../init.d/inetd S40inetd cd ../rc0.d sudo ln -s ../init.d/inetd K40inetd cd ../rc6.d sudo ln -s ../init.d/inetd K40inetd cd ../..
Additionally, we will also need to disable some security to get telnet working.
Comment out #auth [success=ok ignore=ignore user_unknown=ignore default=die] pam_securetty.so from etc/pam.d/login
You are ready to go. But perhaps we can do one more thing before unplugging the HDD. That is to set up apt so we can install some applications.
Setting up apt
Add repositories
Replace etc/apt/sources.list with
deb http://archive.debian.org/debian/ lenny main non-free contrib
deb-src http://archive.debian.org/debian/ lenny main non-free contrib
# Volatile:
deb http://archive.debian.org/debian-volatile lenny/volatile main contrib non-free
deb-src http://archive.debian.org/debian-volatile lenny/volatile main contrib non-free
# Backports:
deb http://archive.debian.org/debian-backports lenny-backports main contrib non-free
# Previously announced security updates:
deb http://archive.debian.org/debian-security lenny/updates main
Since this version of Debian is no longer supported, the repositories have been moved to archive.
Add missing files:
sudo touch var/lib/dpkg/status
sudo mkdir -p var/cache/apt/archives/partial
sudo mkdir -p var/lib/apt/lists/partial
sudo mkdir -p var/lib/dpkg/updates
sudo mkdir -p var/lib/dpkg/info
sudo mkdir -p var/lib/dpkg/alternatives
sudo touch var/lib/dpkg/alternatives/editor.dpkg-new
sudo touch var/lib/dpkg/diversions
sudo touch var/lib/dpkg/available
sudo touch var/lib/dpkg/status
sudo touch var/cache/apt/archives/lock
sudo chmod 640 var/cache/apt/archives/lock
Unmount the drive:
sudo umount /tmp/sda
Use the Device
And you are ready to rock.
Ahh, I almost forgot, you are going to need the root password in order to log in. There are two possibilities here, which are described in the Medium article below. I recommend reading it. The author already found out that the root password is “1”. Yes, it is just a single digit. Now assemble the device and telnet in. You can find the address using nmap -sV 192.168.1.0/24
Understand that many of the packages are out of date here. You might want to install SSH, but even the algorithms supported are deprecated due to security issues. The only way you can secure the box is either by trying to upgrade the system or manually compiling multipbe packages.
I personally ran into some issues in upgrading the OS. That, for my case, really wasn’t worth debugging. The author of the Medium article below managed to upgrade his system without much hassle. We do, however, have different versions of the software. Which might mean that if you find another version, it might be easier.
One last piece of advice: don’t put the box on the internet. This is just asking for trouble.
References
- https://superuser.com/questions/404806/did-debian-lenny-repositories-vanish/404816#404816
- https://www.debian.org/distrib/archive
- https://github.com/olderzeus/Iomega-HMNHDCE
- https://kf106.medium.com/breaking-into-an-old-iomega-home-media-network-hard-drive-cloud-edition-b6501cbc347e
- https://kf106.medium.com/breaking-into-an-old-iomega-home-media-network-hard-drive-cloud-edition-part-ii-fd96b692379f
- https://www.li-pro.de/soho/ihmnhd/start