If you have an old PC laying around, you could setup a simple and affordable NAS (Network Attached Storage) to hold your precious data with functionality equivalent to expensive standalone NAS devices. You will need 2 similar sized hard disks to store the data in a mirror, and old PC and some time to follow the steps below.
CoreStor storage. CoreStor delivers affordable enterprise level performance and availability across diverse workloads and a wide range of environments to power your business-critical applications and help you cost-effectively address the challenges of data growth. The Best NAS (Network Attached Storage) Devices for 2020 Networked storage is the most versatile storage, but that's just one of the many benefits of buying a NAS device.
Hardware Required
- Old PC (Celeron D 2.8, PSU, 4GB ram, gigabit ethernet)
- 16 GB usb stick (used for installing Ubuntu, only 4gb is needed)
- 2x 3GB Western Digital Red Drives (setup in Raid 1 mirror with Btrfs)
- 500gb boot drive (ext4)
- optional (USB dock for cold storage backup to 2gb WD Green drive)
Here are the steps I took to get a simple Ubuntu Server setup, a 2 drive raid 1 mirror (using Btrfs for checksum data integrity), samba share to all devices in the house, CUPS printer sharing an old Brother Laserjet.
I am duplicating this setup on a Raspberry Pi 4b during my holiday break and plan to get rid of this old noisy Celeron PC. You can read about my Raspberry Pi NAS build here.
1) Create a Ubuntu Live Boot USB stick
Download latest Ubuntu Server image iso (Click on option 3 button)
Download Rufus app for Windows to burn that iso to your USB Stick.
When the ubuntu boot disk is created, pop that into your old PC and boot it up.
Imporant to note – Press F2 to go into your BIOS and configure some settings. What I did was disable the unnecessary IDE controller, prioritize the USB stick as the first in the boot sequence, and set CPU fan speed profile to silent. I also made sure the bios saw the 2x WD Red drives, the 500gb boot drive, the USB stick, and the 4 GB of ram. You can also disable the boot logo so you can see any errors that may occur.
2) Install Ubuntu Server
There are quite a few steps to the installation but most are self explanatory. When it gets to the Storage section, I created an EXT4 partition on the 500gb drive that would be the boot drive. Default is to create an LVM but you don't need that if you don't plan to resize your boot partition later. You can also create a Btrfs partition on your media drives but they can also be done later.
Which storage device cannot be erased. Once the install is finished you should be sitting at a login prompt. If you prefer to do the rest of the configuration on your main PC you can connect to your server via a SSH.
Find your servers ip address:
Use a terminal app like Putty or Cmder to connect to your ip.
In Cmder I type the following (replace the ip with what you saw in the previous step)
3) Setup Btrfs 2 disk Raid 1 mirror
You don't have to set up a raid if you really don't want to. Craps side bets. You could just format a single disk to ext4 and call it a day. The benefit of using Btrfs in a mirror configuration is it copies/mirrors data onto two drives redundantly. That way if one of your drives kicks the bucket, you could take the problem drive out and keep working uninterupted, and rebuild the mirror again once you get a replacement hard disk later. Btrfs also does constant checksums over your data, while silently correcting any errors/bad sectors it encounters ensuring your data stays protected from bit rot. Btrfs also supports snapshots so you could go back to a previous state but I don't see myself using that myself.
Ubuntu should have Btrfs built in but in case it doesn't you can install it:
List all the disks, partitions and filesystems found:
If you look at the file sizes you should be able to identify which drives are the large media drives we will setup for the raid. For me it was sda and sdc and in the above image you can see I already have a btrfs partitions for them which I created during the Ubuntu install. If you didn't create the partitions in the Ubuntu installation we can do it now:
Create the btrfs partitions (if you didn't already during the Ubuntu install)
- at the prompt:
- press
'o'
to create an empty new partition - press
'n'
to add a new partition - press
'p'
for primary and then<enter>
for default values for sector sizes etc. - press
'w'
to write to disk and exit fdisk - repeat this for the second disk (in my case
/dev/sdc
)
Create the file system on the new partition and label it Nas:
Here we create the btrfs file system on the first disk (sda) and -f to force it in case there was already an existing partition on it to overwrite. I didn't add a label to the second disk.
Mount your partition, create a subvolume, then mount the subvolume
- Make a new directory called
/mnt/nas
- This mounts the disk so it is available when you navigate to
/mnt/nas
- Go into that directory /mnt/nas
- Creates a subvolume called ‘mediapool'. Name it anything you like.
- Go out of that folder so we can unmount the disk
- Now finally we remount directly to the subvolume we created instead of the disk this time.
- The options I have enabled are zlib compression (suitable for hds, use lzo for SSDs) noatime prevents storing last access time data to increase performance, autodefrag lets btrfs defrag when it needs to in the background
Add the second disk to the pool
Convert the pool to Raid1 and balance the files over the 2 disks
and that is it, we can verify by checking :
While you should be able to access your drives now with everything working, you will find that after a reboot the mounted folders have gone. We need to modify /etc/fstab
to automatically mount on reboot
Modify /etc/fstab to automatically mount the drives on boot
The first line lets us find the UUID of the drive (c2afdb43….)
Second line we can find the subvolume ID (mine was 257)
/etc/sda.
Make a note of it as we will be adding the two in the fstab config file:
ctrl + o
to save, Ctrl + x
to exit the editor.
So thats it. We have created a secure storage space to save your important data. The next step is to share this on your home network to other devices (other windows pcs etc). To do that we will set up a samba share:
4) Setup Samba to share files with Windows systems
Install the samba drivers
Configure Ubuntu firewall to allow Samba through
Configure /etc/samba/smb.conf
There are a few settings to setup for simple folder that we want to share and those settings need to be in smb.conf. First make a copy before of the config file before we start changing it, then use Nano
to open the text editor.
- Use the arrow keys to move around,
Ctrl + o
(then press enter to save the file),Ctrl + x
(to quit the editor)
I will provide my smb.conf file to download if you think you find it easier to start with that.
The key items you need in the config are:
Minecraft vr apk. remove unnecessary shares
Create a samba user
Test the config
Typing the command testparm
will show your configuration settings. If you notice something missing here that you are sure you added in the configuration file, there is probably a typo somewhere to fix.
There are quite a few steps to the installation but most are self explanatory. When it gets to the Storage section, I created an EXT4 partition on the 500gb drive that would be the boot drive. Default is to create an LVM but you don't need that if you don't plan to resize your boot partition later. You can also create a Btrfs partition on your media drives but they can also be done later.
Which storage device cannot be erased. Once the install is finished you should be sitting at a login prompt. If you prefer to do the rest of the configuration on your main PC you can connect to your server via a SSH.
Find your servers ip address:
Use a terminal app like Putty or Cmder to connect to your ip.
In Cmder I type the following (replace the ip with what you saw in the previous step)
3) Setup Btrfs 2 disk Raid 1 mirror
You don't have to set up a raid if you really don't want to. Craps side bets. You could just format a single disk to ext4 and call it a day. The benefit of using Btrfs in a mirror configuration is it copies/mirrors data onto two drives redundantly. That way if one of your drives kicks the bucket, you could take the problem drive out and keep working uninterupted, and rebuild the mirror again once you get a replacement hard disk later. Btrfs also does constant checksums over your data, while silently correcting any errors/bad sectors it encounters ensuring your data stays protected from bit rot. Btrfs also supports snapshots so you could go back to a previous state but I don't see myself using that myself.
Ubuntu should have Btrfs built in but in case it doesn't you can install it:
List all the disks, partitions and filesystems found:
If you look at the file sizes you should be able to identify which drives are the large media drives we will setup for the raid. For me it was sda and sdc and in the above image you can see I already have a btrfs partitions for them which I created during the Ubuntu install. If you didn't create the partitions in the Ubuntu installation we can do it now:
Create the btrfs partitions (if you didn't already during the Ubuntu install)
- at the prompt:
- press
'o'
to create an empty new partition - press
'n'
to add a new partition - press
'p'
for primary and then<enter>
for default values for sector sizes etc. - press
'w'
to write to disk and exit fdisk - repeat this for the second disk (in my case
/dev/sdc
)
Create the file system on the new partition and label it Nas:
Here we create the btrfs file system on the first disk (sda) and -f to force it in case there was already an existing partition on it to overwrite. I didn't add a label to the second disk.
Mount your partition, create a subvolume, then mount the subvolume
- Make a new directory called
/mnt/nas
- This mounts the disk so it is available when you navigate to
/mnt/nas
- Go into that directory /mnt/nas
- Creates a subvolume called ‘mediapool'. Name it anything you like.
- Go out of that folder so we can unmount the disk
- Now finally we remount directly to the subvolume we created instead of the disk this time.
- The options I have enabled are zlib compression (suitable for hds, use lzo for SSDs) noatime prevents storing last access time data to increase performance, autodefrag lets btrfs defrag when it needs to in the background
Add the second disk to the pool
Convert the pool to Raid1 and balance the files over the 2 disks
and that is it, we can verify by checking :
While you should be able to access your drives now with everything working, you will find that after a reboot the mounted folders have gone. We need to modify /etc/fstab
to automatically mount on reboot
Modify /etc/fstab to automatically mount the drives on boot
The first line lets us find the UUID of the drive (c2afdb43….)
Second line we can find the subvolume ID (mine was 257)
/etc/sda.
Make a note of it as we will be adding the two in the fstab config file:
ctrl + o
to save, Ctrl + x
to exit the editor.
So thats it. We have created a secure storage space to save your important data. The next step is to share this on your home network to other devices (other windows pcs etc). To do that we will set up a samba share:
4) Setup Samba to share files with Windows systems
Install the samba drivers
Configure Ubuntu firewall to allow Samba through
Configure /etc/samba/smb.conf
There are a few settings to setup for simple folder that we want to share and those settings need to be in smb.conf. First make a copy before of the config file before we start changing it, then use Nano
to open the text editor.
- Use the arrow keys to move around,
Ctrl + o
(then press enter to save the file),Ctrl + x
(to quit the editor)
I will provide my smb.conf file to download if you think you find it easier to start with that.
The key items you need in the config are:
Minecraft vr apk. remove unnecessary shares
Create a samba user
Test the config
Typing the command testparm
will show your configuration settings. If you notice something missing here that you are sure you added in the configuration file, there is probably a typo somewhere to fix.
Start Samba and NetBios Name Services
Assign user rights to the shared NAS folder
This is the final step of the puzzle. If you dont assign rights you might be pulling your hair out like I was, being able to see the nas folder but unable to save/write any changes to it.
Thats it! Congratulations, go over to your Windows PC and navigate to your ip in file explorer 192.168.1.103
and you should see your shared folder waiting for you!
Optional, you can add a usb printer to the server and share that for every device in your home (win/mac/iphone/ipads). Setup a CUPS Print Server on Ubuntu
Safari stable release.
Resources:
Btrfs commands : BTRFS Fun – Funtoo
Fdisk commands : 10 fdisk Commands to Manage Linux Disk Partitions (tecmint.com)
Btrfs manual mounting : Manpage/btrfs(5) – btrfs Wiki (kernel.org)
Raid types visualized : RAID 0, RAID 1, RAID 5, RAID 10 Explained with Diagrams (thegeekstuff.com)
- Hardware, Turbo & Value Class RAID Solutions
- RAID 0, 1, 5, 6, 10, 50 & JBOD
- 4 & 8 Bay Diskless Tower Enclosures
- Up to 112TB of Storage Capacity
- Windows, Mac OS X, Linux & FreeBSD
We manufacture a wide range of professional-grade Tower RAID Enclosure Storage solutions for Mini-SAS connectivity. These robust, high-quality RAID solutions can directly support up to 112TB of SAS or SATA storage, and are powered by our industry proven Hardware, Turbo and Value RAID architecture. HighPoint Mini-SAS RAID Enclosure Solutions are available for nearly any DAS applications, platforms and budget. Each RocketStor enclosure includes an intuitive user-friendly web-based management interface available for Windows, macOS, Linux, and FreeBSD operating systems. Novices and experts alike, can quickly and easily configure, monitor, maintain and troubleshoot RAID configurations and individual storage devices, all from a single, unified software suite.
RocketStor RAID Solutions are available in 3 distinct RAID Solution Classes:
RocketStor Hardware RAID Solutions are the industry's most affordable Hardware RAID Storage Solutions, and are powered by our industry-proven Hardware RAID 5/6 Technology.
RocketStor Hardware RAID Solutions were designed for Professional Business and Media Applications that demand superior performance and uncompromised data availability.
Superior Performance: The dedicated Hardware RAID Engine and onboard cache allow the RocketStor to work independently to avoid compromising RAID performance due to the lack of system resources. DV Mode Technology intelligently manages the flow of large data blocks and write-back caching to minimize latency & ensure consistent, sustained high-performance transfers for media-rich applications.
Uncompromised Storage Availability and Accessibility: RocketStor Hardware RAID Solutions feature a series of preemptive security measures to maximize Storage uptime whenever data is needed. Redundant RAID 5 and 6 protection shields storage configurations from 1 or 2 disk failures, respectively. The RocketStor Storage Health Inspector (SHI) proactively maintains the health of arrays by examining each drive for failed sectors & Dynamically Repair/Remap on the fly to keep storage ready & able.
Robust RAID Recovery - HighPoint Hardware RAID solutions feature built-in NVRAM, which constantly tracks in-progress writes to preserve the integrity of data in the event of a drive failure or system crash, and streamline recovery procedures while minimizing downtime. Administrators can initialize or schedule RAID verification sessions that check each disk member of an array for parity consistency. If any parity related problems are found, the interface will immediately rebuild the array to ensure the integrity of your data.
Simple and Easy Storage Expansion: Online Capacity Expansion and RAID Migration allow customers to modify RAID configurations or expand existing storage while avoiding complicated, time consuming backup and restoration procedures.
Hardware RAID Class RAID Tower Enclosures:
Raid Storage Levels
Model | RocketStor 6418AS | RocketStor 6414AS |
Product Image | ||
Connectivity | SFF-8088 (Mini-SAS) | SFF-8088 (Mini-SAS) |
RAID Level | 0, 1, 5, 6, 10, 50 & JBOD | 0, 1, 5, 6, 10, JBOD |
# Of Drive Bays | 8 | 4 |
Max. Storage capacity | 96TB | 48TB |
Drive Interface | SAS/SATA | SAS/SATA |
RocketStor Mini-SAS Turbo RAID Tower Enclosures employ our industry proven Turbo RAID Technology which leverages the powerful resources of today's modern computing platforms to deliver high-performance data transfer with robust RAID 5 & 6 protection, at the industry's best price points.
Industry's Most Affordable RAID 6 Storage Solution: The majority of today's PC platforms benefit from efficient, high-performance processors and abundant cost-effective memory. RocketStor Turbo RAID solutions were designed to intelligently utilize these surplus system resources to accelerate or maximize the transfer performance potential of RAID storage applications. RocketStor Turbo Class offer exceptional RAID level support from RAID 0, 1, 5, 6, 10, 50 & JBOD, robust redundant RAID 5 and 6 protection shields storage configurations from 1 or 2 disk failures without compromising data accessibility.
Efficient RAID Recovery Solution: RocketStor Turbo RAID solutions save and manage redundant RAID Configurations which can be used to recover disabled arrays in the case of a power outage or severe hardware failure.
Simple and Easy Storage Expansion: Online Capacity Expansion and RAID Migration allow customers to modify RAID configurations or expand existing storage while avoiding complicated, time consuming backup and restoration procedures.
Turbo RAID Class RAID Tower Enclosures:
Raid Storage Drive
Model | RocketStor 6418TS | RocketStor 6414TS |
Product Image | ||
Connectivity | SFF-8088 | SFF-8088 |
RAID Level | 0, 1, 5, 6, 10, 50 & JBOD | 0, 1, 5, 6, 10, JBOD |
# Of Drive Bays | 8 | 4 |
Max. Storage capacity | 96TB | 48TB |
Drive Interface | SATA | SATA |
The majority of today's PC platforms benefit from efficient, high-performance processors and abundant cost-effective memory. HighPoint Value Class RAID solutions are powered by our industry proven RAID stack and leverage the powerful system resources and robust 2nd generation PCIe x4 host interface of today's modern computing platforms to deliver highly affordable RAID 5 storage solutions.
Cost-Efficient RAID 5 Storage Solutions: The majority of today's PC platforms benefit from efficient, high-performance processors and abundant cost-effective memory. HighPoint Value RAID solutions were designed to take full advantage of these hardware environments in order to deliver cost-effective redundant RAID storage protection for a variety of applications.
Value RAID Class RAID Tower Enclosures: https://linglaraci1982.mystrikingly.com/blog/tipard-hd-converter-9-1-16.
Model | RocketStor 6414VS |
Product Image | |
Connectivity | SFF-8088 |
RAID Level | 0, 1, 5, 10, JBOD |
# Of Drive Bays | 4 |
Max. Storage capacity | 48TB |
Drive Interface | SATA |
Robust, High-Quality 6Gb/s Mini-SAS Tower Enclosures
The RocketStor 6414S and 6418S are a stylish, high-quality storage tower enclosures that feature external SFF-8088 Mini-SAS ports and removable hot-swap bays which support any 2.5' or 3.5' SATA Hard Drive or SSD of your choice. Customers have the freedom to use their choice of RocketRAID host adapter and storage device; SATA SSD's for performance or large hard disks for maximum capacity, from all major drive brands including HGST, Seagate, Toshiba and WDC.The enclosure features built in LED's and an audible alarm that quickly notify administrators in the case of hardware failure or environmental warning such as power loss or overheating.
Model | RocketStor 6418S | RocketStor 6414S |
Product Image | ||
Connectivity | SFF-8088 (Mini-SAS) | SFF-8088 (Mini-SAS) |
# Of Drive Bays | 8 | 4 |
Max. Storage capacity | 128TB | 64TB |
Drive Interface | SAS/SATA | SAS/SATA |