Forum archive
Adding Hard Drives after first install
I have 4 Hard Dives plus a 500 GB SSD in my box I am running Turnky NAS on. the Program does not recognize my 4 4TB SAS Drives I have hooked to the SATA Ports on my MB.
How do I add those drives to the system, either as one big pool, or in a raid configuration.
Assuming that I'm right and you're using the TurnKey Fileserver appliance, then by default what you are seeing is expected behaviour. When installed to bare metal, TurnKey defaults to just using the boot drive.
If I recall correctly, you should be able to format and configure the additional drives within Webmin. But personally, I prefer the commandline. Having said that, rather than physically using the terminal on your fileserver, I suggest using SSH (I recommend PuTTY if you're on Windows; on Linux and Mac just use the built in command).
IMO the best way to have a big storage pool in Linux is via LVM (Logical Volume Manager). I won't go into details here, but essentially LVMs are a way to abstract the physical storage from the OS. With LVM there are 3 levels; PVs (physical volumes - usually complete disks, but can be individual partitions), VGs (volume groups, groups of PVs) and LVs (logical volumes - what the OS uses as it would a normal disk).
So I'll assume that you installed to a LVM when you installed from the ISO (it's the default option). So you should already have a VG called "turnkey". To double check, you can view the current PVs, VGs and LVs with the respective commands; "pvdisplay", "vgdisplay" and "lvdisplay". Here's the output from a VM I have installed (as you can see it has a 8GB vHDD):
Checking the current LVM set up
First check the PVs with "pvdisplay":
So I have 1 PV (/dev/sda) which is a part of the "turnkey" VG. We don't really need to know the info that "vgdisplay" will show, but let's have a look anyway:
Note the line that shows the free space ("Free PE / Size") - I actually have 824.00MB free. Again I won't go into detail, but that space is reserved by default for snapshots. If you're not using that functionality, then you can use all the space if you want...
Also out of interest, I'll check the LVs I have with "lvdisplay":
So in my "turnkey" VG I have 2 LVs; "root" (the OS) and "swap_1" (my swap volume, more-or-less virtual memory aka pagefile).
Checking the currently connected disks/volumes
First let's double check what disks TurnKey can see. To list all the disk-like devices that the system can see, use:
I only have one (virtual) physical disk (/dev/sda), but here's what it looks like:
It's showing both the "real" disk (/dev/sda), plus the LVs. Looks for the ones that start with "/dev/sdX" (see above that mine is /dev/sda). I'll assume that the other 4 disks you have are listed as /dev/sdb, /dev/sdc, /dev/sdd and /dev/sde.
Adding the HDDs and setting up a new VG and LV
You could add the 4 HDDs to the existing VG and then create a new LV if you wished, but let's keep the SSD and the older style "spinney" drives separate. We can do that by making a new "hdd" VG (I'm calling mine "hdd", but you can call it something different if you want) by pooling the 4 x 4TB HDDs together. Then I'll create a single volume to use as storage, which I'll call "storage".
Add all 4 of these disks to as PVs and add them to a new "hdd" VG:
Now assuming that you don't want to use the snapshots feature of LVM (if you do, please have a read up on how that works...) you can create a new LV called "storage" and use the whole volume group (i.e. 100% of the 16TB; if you want smaller, either use a different percentage, or instead use the '-L' switch with a specific size):
Assuming that all goes successfully, you can now view your new volume like this:
Format and set up the new LV
So now format the new volume:
I'm going to mount it to /srv/storage (the default storage location of the Samba shares on the fileserver appliance). To make sure that it's added at boot time, I'll include it in the fstab file:
Mount the new LV and final check
And finally to mount it and check that it's mounted:
That should return something like this:
Assuming so, you should now be all good to go! :)