<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Storage on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/storage/</link><description>Recent content in Storage on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Sun, 03 Sep 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/storage/index.xml" rel="self" type="application/rss+xml"/><item><title>Testing Storage Speed</title><link>https://blog.iankulin.com/testing-storage-speed/</link><pubDate>Sun, 03 Sep 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/testing-storage-speed/</guid><description>&lt;p&gt;Now I&amp;rsquo;ve added NVME drives to my nodes, plus added an external NMVE RAID, I&amp;rsquo;ve got quite the collection of storage options. For one of my nodes, it looks like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-07-23-at-1.20.34-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-23-at-1.20.34-pm.png" width="979" alt="Screenshot of Proxmox GUI showing 5 storage options"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The 256GB NVME the OS is installed to&lt;/li&gt;
&lt;li&gt;The 512GB SSD, currently running ZFS&lt;/li&gt;
&lt;li&gt;The Synology NAS - 4 x 6TB drives in RAID 5 on a 1GB switch&lt;/li&gt;
&lt;li&gt;A pair of 256GB NVME sticks in an external USB3 enclosure set up as a mirrored ZFS pool.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For my dev VM&amp;rsquo;s I often set them up to have their storage on the NAS - it&amp;rsquo;s just super easy to move them around then. The production VM&amp;rsquo;s currently have their storage on the SSD (that machine hasn&amp;rsquo;t had the NVME upgrade yet), but obviously with all these options, it&amp;rsquo;d be interesting to think about what goes where.&lt;/p&gt;
&lt;p&gt;The biggest lots of files - media and distro ISO&amp;rsquo;s are clearly going to be on the NAS. No thinking to do there. Production VM backups also go there, and now I&amp;rsquo;ve got room they might also go cross-node as an extra layer of redundancy.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s really the live VM hard disks that need a decision. So I need to do some measuring.&lt;/p&gt;
&lt;p&gt;Jim Salter - one of the ZFS kings on the &lt;a href="https://2.5admins.com/"&gt;2.5 Admins&lt;/a&gt; podcast has an &lt;a href="https://arstechnica.com/gadgets/2020/02/how-fast-are-your-disks-find-out-the-open-source-way-with-fio/"&gt;article on drive speed testing&lt;/a&gt; that&amp;rsquo;s worth reading even just for the good descriptions of different drives and the range of workloads to consider.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://arstechnica.com/gadgets/2020/02/how-fast-are-your-disks-find-out-the-open-source-way-with-fio/"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-07-23-at-4.42.31-pm.jpg" alt="Article headline: How fast are your disks? Find out the open source way,
with fio."&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;He ends up recommending three tests using &lt;code&gt;fio&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Writing 4K blocks randomly - disks do not enjoy this&lt;/li&gt;
&lt;li&gt;Having 16 parallel processes write 64K blocks to random locations in 256MB files&lt;/li&gt;
&lt;li&gt;Writing 1MB blocks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I ran all of those tests once on each of my storage options and this is what we got.&lt;/p&gt;
&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;NVME&lt;/td&gt;&lt;td&gt;NAS/NFS/RAID 5&lt;/td&gt;&lt;td&gt;SDD/ZFS&lt;/td&gt;&lt;td&gt;External NVME RAID 1 ZFS&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Single 4KiB random write process&lt;/td&gt;&lt;td&gt;430&lt;/td&gt;&lt;td&gt;17.9&lt;/td&gt;&lt;td&gt;80.6&lt;/td&gt;&lt;td&gt;75.7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;16 parallel 64KiB random write processes&lt;/td&gt;&lt;td&gt;2328&lt;/td&gt;&lt;td&gt;4897&lt;/td&gt;&lt;td&gt;267&lt;/td&gt;&lt;td&gt;135&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Single 1MiB random write process&lt;/td&gt;&lt;td&gt;651&lt;/td&gt;&lt;td&gt;70.7&lt;/td&gt;&lt;td&gt;379&lt;/td&gt;&lt;td&gt;195&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;&lt;em&gt;Speeds in MB/s&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You can better see how crazy this is in a graph.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/picture-1.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;What is up with the figure for the NAS 16 x 64K?&lt;/p&gt;
&lt;p&gt;Probably worth talking about what I was expecting. I thought the internal NVME would be quickest, then the internal SDD, then the external NVME RAID then the NAS since it&amp;rsquo;s over the network.&lt;/p&gt;
&lt;p&gt;Given the excellent speed of the internal NVME, the external NMVE was a d=bit disappointing, but it&amp;rsquo;s got a few factors going against it. One is that it&amp;rsquo;s talking over USB 3 which has a theoretical 600MB/s limit, but we&amp;rsquo;re well under that. More likely it&amp;rsquo;s the ZFS - a system that is focused on data integrity rather than speed. But then the external drive is worse that the internal SATA SSD - and they both have ZFS with compression turned on. The enclosure is a no-name brand one, so we don&amp;rsquo;t really know the quality of it&amp;rsquo;s USB 3.0 implementation.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m dubious about the data for the NAS. When I first ran the 4K test it took so long, I killed the process a couple of times thinking it was frozen. The test command limits all three tests to a minute, so you&amp;rsquo;d expect them to take just a few seconds more than that, but all the NAS tests seemed to hang on the very last piece of output for minutes. I&amp;rsquo;m wondering is there was some smart caching going on, but then it waited in an async way to complete. Jim actually discusses that this is the purpose of the &lt;code&gt;--end_fsync=1&lt;/code&gt; in the commands so likely that&amp;rsquo;s it. I&amp;rsquo;ll have a think about how to adjust for this for a future post.&lt;/p&gt;
&lt;h3 id="cost-of-zfs"&gt;Cost of ZFS&lt;/h3&gt;
&lt;p&gt;What would the story be on the internal SSD if we turn the ZFS compression off, or just use ext4?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/ssd-speed.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;It looks like compression has quite a cost on the little writes. It&amp;rsquo;s not a simple matter though - you could expect a speed improvement in many situations if the data compresses well. I had a look at the data in some of the test files that were generated, and it seemed quite random which is probably the worst case scenario for compression. Even so, in the graphs above the compressed looks like it did better than the uncompressed for the 64K random writes. I didn&amp;rsquo;t bother to replicate the tests, so it&amp;rsquo;s possible that&amp;rsquo;s just noise.&lt;/p&gt;
&lt;p&gt;Looking at the external dual NVME USB 3 drive with compression on/off is a similar story.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/external.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;A big increase for the small writes, slight decrease in the parallel ones.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s really a bit hard to come to any conclusions from all this, but let&amp;rsquo;s have a go:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;There&amp;rsquo;s a speed penalty for using ZFS at all&lt;/li&gt;
&lt;li&gt;ZFS compression is expensive for many small writes of uncompressible data&lt;/li&gt;
&lt;li&gt;I need to know more about fio to figure out what was going on with that near impossible speed&lt;/li&gt;
&lt;li&gt;NVME is really fast connected to the bus, plugged in through USB, not so much&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Based on this, I wish I&amp;rsquo;d bought bigger NVME drives - that might be a future plan when I&amp;rsquo;ve run these for a while. These 256GB ones were $20 each which is just about a disposable price. They&amp;rsquo;ll probably end up as cache for a NAS or something in the future. In the mean time, I&amp;rsquo;ll format my SATA SSDs with ZFS with no compression and the VM disks will live on them. The benefits I get from that (100% data integrity checks with scrubs, and easy transfer of snapshots) seem like a reasonable tradeoff for a little speed.&lt;/p&gt;</description></item><item><title>Using NAS for Proxmox backups</title><link>https://blog.iankulin.com/using-nas-for-proxmox-backups/</link><pubDate>Mon, 10 Apr 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/using-nas-for-proxmox-backups/</guid><description>&lt;p&gt;&lt;a href="https://blog.iankulin.com/moving-a-vm-between-two-proxmox-hosts/"&gt;A few weeks ago&lt;/a&gt;, I was very excited to be able to take a snapshot of a virtual machine, copy it across the network from that Proxmox node, copy it back across the network to a different Proxmox node, start it there, and have it up and running, without it noticing it was actually on different hardware.&lt;/p&gt;
&lt;p&gt;Backing up a VM is pretty simple, you just click on the node, choose &lt;em&gt;Backup&lt;/em&gt; and click the &lt;em&gt;Backup Now&lt;/em&gt; button. The ease, and completeness of backing up a VM is one of the main reasons I&amp;rsquo;m using Proxmox for my systems.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-12.02.59-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-12.02.59-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By default, VM backups are saved to the &amp;ldquo;local drive&amp;rdquo; - actually the &lt;code&gt;/var/lib/vz&lt;/code&gt; directory. This would not be useful if the physical machine dies, but also it&amp;rsquo;s not convenient to restore to a different machine. Ideally you&amp;rsquo;d have a central place to store these files that was accessible to all the Proxmox nodes.&lt;/p&gt;
&lt;p&gt;This is exactly the situation I&amp;rsquo;ve setup with my lab, the NAS is the storage for the VM backups. Each of the Proxmox nodes uses the same directory for backups, so moving a machine from one node to another is a simple as backing it up on one node, stopping the VM, and restoring it on another node just by choosing the backup file to restore in the web GUI.&lt;/p&gt;
&lt;h3 id="steps"&gt;Steps&lt;/h3&gt;
&lt;p&gt;Proxmox can use all sorts of shares as a location for backups (and other files such as the ISO&amp;rsquo;s used to boot new machines), but the simplest is probably &lt;a href="https://en.wikipedia.org/wiki/Network_File_System"&gt;NFS&lt;/a&gt;. This is also straightforward to do from the Synology NAS.&lt;/p&gt;
&lt;p&gt;In the web interface for the NAS, go into &lt;em&gt;Control Panel&lt;/em&gt;, &lt;em&gt;Shared Folder&lt;/em&gt; and create a new shared folder. I called mine Proxmox. One of the tabs there is for NFS permissions - just add the IP address of the Proxmox node that you&amp;rsquo;d life to access the folder.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-1.46.02-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not much harder from the Proxmox end. Although the storage you add will appear at the node level in the &lt;em&gt;Server View&lt;/em&gt; of the web GUI, it is added at the &lt;em&gt;Datacenter&lt;/em&gt; level.&lt;/p&gt;
&lt;p&gt;Go into &lt;em&gt;Storage&lt;/em&gt;, select &lt;em&gt;Add&lt;/em&gt; and choose &lt;em&gt;NFS&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.00.04-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.00.04-pm.png" width="800" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then enter an ID (this will be the name of the storage in Proxmox) and the IP address. If you wait half a second, then you can click the dropdown for all the folders that are shared from that IP address.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.06.19-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The last field is content - this refers the the type of Proxmox stuff you want to keep in there - for backups, you just need VZDumps, but I usually click on everything since I&amp;rsquo;ll also use it for ISOs for new VMs and templates for LXCs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.11.03-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added that, the storage will appear in the server view, but also as an option when you go into &lt;em&gt;Backup&lt;/em&gt; for a VM and select &lt;em&gt;Backup Now&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-04-07-at-2.15.53-pm.png" alt=""&gt;&lt;/p&gt;</description></item><item><title>NAS Storage Calculations</title><link>https://blog.iankulin.com/nas-storage-calculations/</link><pubDate>Sat, 11 Mar 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/nas-storage-calculations/</guid><description>&lt;p&gt;I&amp;rsquo;ve been really happy with my two bay Synology NAS - a DS216j. The Synology&amp;rsquo;s seem to have great reputation for just pushing on. Mine is loaded up with two 8TB Seagate Barracudas in RAID 1 leaving me with a one drive failure redundancy.&lt;/p&gt;
&lt;p&gt;I guess a more hard-core host-er than me would be building their own array and using Unraid or ZFS or something. I&amp;rsquo;m pretty comfortable with the Synology off the shelf system; it&amp;rsquo;s a good match for my (low) level of expertise, and more robust than my previous storage system of a USB external drive.&lt;/p&gt;
&lt;p&gt;As I start to move real world applications out of the cloud and on to self-hosting, I need to be serious about availability and data security. The general standard for this in the self-hosting community seems to be three versions of data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;production version&lt;/li&gt;
&lt;li&gt;local backup&lt;/li&gt;
&lt;li&gt;remote backup&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I feel like the local and remote backups don&amp;rsquo;t &lt;em&gt;have&lt;/em&gt; to be NAS - a large enough external drive might be a reasonable cost saving. I would like the local backup to be able to be swapped into production though, so even if it was an external USB drive and would provide a degraded service, it should be able to be used to maintain services.&lt;/p&gt;
&lt;p&gt;A few days ago, there was an 8 bay, hot swappable Synology on eBay that got me a bit excited thinking about running different pools with a variety of RAIDs or just packing it with low cost smaller HDDs. Luckily I didn&amp;rsquo;t win it, but it triggered me to think about exactly what I need and what the trade-offs are.&lt;/p&gt;
&lt;h3 id="drive-quality"&gt;Drive Quality&lt;/h3&gt;
&lt;p&gt;The drives I&amp;rsquo;ve got in my NAS are second-hand, brand name non-NAS drives. They had just under 9000 hours on them, and the company selling them had hundreds of identical drives. From this, I&amp;rsquo;m assuming they came out of a data centre who replace drives at the one year mark.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s possible to buy &amp;ldquo;NAS&amp;rdquo; drives (and also &amp;ldquo;surveillance&amp;rdquo; drives) which are sold for uses where they are in use 24/7. They cost more.&lt;/p&gt;
&lt;p&gt;Is it possible these two types of drives (and perhaps even the USB external drives) are all the same drives, just marketed differently? Well, it&amp;rsquo;s possible. But it&amp;rsquo;s also possible they are mechanically identical, but have been sent to different market segments based on their initial test results.&lt;/p&gt;
&lt;h3 id="raid"&gt;RAID&lt;/h3&gt;
&lt;p&gt;RAID is a way of combining physical disks into one logical volume, usually in a way that reduces the capacity but allows for a drive failure without data loss. There&amp;rsquo;s several different &amp;rsquo;levels&amp;rsquo; of RAID. My current setup is RAID1 - I have two 8TB disks which present to the system as a single 8TB disk, but if one drive fails, I still have access to all of my data. If you have more than a couple of disks, RAID5 is a better option - if you had 3 x 8TB drives, you&amp;rsquo;d end up with 16TB usable space, and still be able to tolerate one drive failure. If you&amp;rsquo;re super cautious, RAID6 will allow two drive failures before you&amp;rsquo;re in danger. Of course this comes at a cost, if we had a 4x 8TB drive setup, there&amp;rsquo;d only be 16TB available, but any two of the drives could die without stopping the system.&lt;/p&gt;
&lt;h3 id="scoping-out-the-options"&gt;Scoping out the options&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve decided I need about 12TB - I currently have about 3TB of media locally and 0.5TB of general data on my laptop, that&amp;rsquo;s backed up to an external drive about weekly, along with about 20GB in DropBox. The bottom Dropbox plan is about AUD190 for 2TB, and I&amp;rsquo;m only using a fraction of it, so as part of my self-hosting that will get canned. 12TB seems like a lot of headroom from 4TB which is about where I&amp;rsquo;m sitting. I&amp;rsquo;d like to offer a couple of TB to whichever relative ends up hosting my remote backup. And finally it&amp;rsquo;s a multiple of 6TB which is a common ex-enterprise second hand drive size on ebay, so I know I can get year old ones for about $100&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll run through the thinking of each of the options I&amp;rsquo;ve considered.&lt;/p&gt;
&lt;h3 id="ds412"&gt;DS412+&lt;/h3&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-10-at-5.14.28-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;I had a couple of Synologys with more bays than this in my eBay watchlist, but as you add drives, you add power consumption and heat, so I think realistically at the 12TB point, 4 bays is the most you could justify. There&amp;rsquo;s a bit of a price step up as well when you go to five bays and leave the serious home user segment of the market.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s worth mentioning how the Synology model numbers work in the DS range. My existing unit is a DS216j. The 2 is for two bays and it&amp;rsquo;s 2016 model. So the DS412+ is from 2012 and has four bays. The &amp;lsquo;j&amp;rsquo; on mine denotes its a mouse-power CPU - in this case a Marvell Armada 385 - some sort of low power ARM. The DS412+ is rocking a bigger mouse - the Intel Atom D2700, and it has a bit more RAM.&lt;/p&gt;
&lt;p&gt;The processor is not a big deal to me. Some folk host a lot of apps - media servers etc on their NAS. I&amp;rsquo;m not planning to do that. As long as it can run Tailscale in a container (which the &amp;lsquo;j&amp;rsquo; models can) we&amp;rsquo;re good to go.&lt;/p&gt;
&lt;p&gt;My theory with drive quality is that the lower the quality of the drive, the higher level RAID I need. So If I scope this unit out with the $100 used, non-NAS drives, I can install four disks as RAID6, have two fail on the same day, and still be operational.&lt;/p&gt;
&lt;p&gt;This second-hand (about ten years old) unit was on &amp;ldquo;buy now&amp;rdquo; for $416, the four year old drives adds $440 making it $856 unit - around $71/TB. The quoted power draw is 44W which works out at 3.7W/TB - the highest of everything I considered.&lt;/p&gt;
&lt;h3 id="ds420j"&gt;DS420j&lt;/h3&gt;
&lt;p&gt;Thinking about likely points of failure with the eleven year old NAS (if I used the DS412j) made me wonder if a unit failure might be higher on the probability list than a second-hand drive failure. The answer is who knows? - probably both events are quite unlikely. However I have some redundancy built in to the drives, but a single point of failure in the NAS unit. It made me wonder what a new 4 bay Synology costs, and the answer is not much more.&lt;/p&gt;
&lt;img src="https://blog.iankulin.com/images/27459.jpg" width="229" alt=""&gt;
&lt;p&gt;This DS420j is again 4 bays, and like the older 4 nay unit it&amp;rsquo;s hot-swapable. This means that in the event of a drive failure, you can leave the NAS running, remove the faulty drive and insert a new one. The unit will then (slowly) rebuild the RAID array, but while you are removing a drive and rebuilding the RAID the system is still fully operational.&lt;/p&gt;
&lt;p&gt;Listed at $439, that works out to $880 total if I used the same second-hand 6TB drives as in the calculation above. So with my RAID 6 (two drive failures can be tolerated without losing data) the cost per TB is $73 - only a couple more than in the first example.&lt;/p&gt;
&lt;p&gt;Apart from the peace of mind of running a newer unit, there&amp;rsquo;s a big difference in power consumption. The DS420j uses 44W, this one is 22W with all the drives spinning, or if you allow them to hibernate as low as 8W. So the max power burn is half at 1.8W per TB&lt;/p&gt;
&lt;h3 id="trading-raid"&gt;Trading RAID&lt;/h3&gt;
&lt;p&gt;RAID 6 - where I&amp;rsquo;m installing 4 x 6TB drives, and only ending up with 12TB of usable space is very conservative - and I was doing that because I was using the second hand drives. What if I bought cheap, but still brand name HDDs, but only three of them and configured as RAID 5 so I&amp;rsquo;d still get 12TB of usable disk, and a single drive can fail without affecting my data?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-03-10-at-5.40.03-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-03-10-at-5.40.03-pm.png" width="239" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There are no three bay Synologys, so I&amp;rsquo;d use the same NAS as above - the DS420j. I can buy three Seagate Skyhawk 6TB disks for $660, so the total comes to $1100 or $92/TB - quite a bit more than four of the older drives in RAID6. With less drives spinning, we can probably assume a total power consumption of around 15W - 1.25W/TB&lt;/p&gt;
&lt;h3 id="even-less-disks"&gt;Even less disks&lt;/h3&gt;
&lt;p&gt;What if we reduce the number of disks even further? If we double the drive capacity to 12TB we could run 2 x 12TB drives as RAID1, have a smaller NAS, save some power, and still have a single drive fail with no data loss. We might want to go to an even higher quality of drive, perhaps one of the ones rated for NAS use - The cheapest new brand name 12TB NAS drive on eBay was a Seagate IronWolf. Two of those costs $756. The two bay DS220j NAS only adds $241 for a total of $997 - $83/TB. Power looks great at 1.1W/TB.&lt;/p&gt;
&lt;p&gt;These smaller NAS&amp;rsquo;s are not hot-swappable. You have to power down the NAS to replace a drive. This is not as cool as just clicking a button and sliding a drive out while all your services are still up, but it&amp;rsquo;s not really a significant factor in my decision making.&lt;/p&gt;
&lt;h3 id="disk-singular"&gt;Disk singular&lt;/h3&gt;
&lt;p&gt;I wouldn&amp;rsquo;t do this for my production storage, but it&amp;rsquo;s worth mentioning the single disk NAS. You&amp;rsquo;d want the best quality of drive possible, and probably schedule to swap it out after three years or so. A Synology single drive NAS with a NAS rated drive is a big step up in quality and convenience from an external USB drive. With that same IronWolf 12TB drive and a DS120j you&amp;rsquo;d be out of pocket $578 or $48/TB, and power is down to 0.83W/TB.&lt;/p&gt;
&lt;h3 id="ye-olde-usb-drive"&gt;Ye Olde USB Drive&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;ve not had a USB drive failure, but mine generally live a happy life powered down in a cool dry drawer until they are fished out for a backup session. Just by way of a comparison to the options above, a WD &amp;ldquo;Elements&amp;rdquo; USB drive costs the same as the single disk NAS at $580 ($48/TB) but the power is down at 0.67W/TB. The cheaper Seagate &amp;ldquo;One Touch Desktop Hub&amp;rdquo; drive works out at $35/TB and 0.83W/TB&lt;/p&gt;
&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;strong&gt;NAS&lt;/strong&gt;&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;strong&gt;Disks&lt;/strong&gt;&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;strong&gt;Total&lt;/strong&gt;&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;strong&gt;$/TB&lt;/strong&gt;&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;&lt;strong&gt;W/TB&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="has-text-align-center" data-align="center"&gt;DS412+&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;4 x 6TB used&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;$856&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;71&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;3.7&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="has-text-align-center" data-align="center"&gt;DS420j&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;4 x 6TB used&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;$880&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;73&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;1.8&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="has-text-align-center" data-align="center"&gt;DS420j&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;3 x 6TB new&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;$1,100&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;92&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;1.25&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="has-text-align-center" data-align="center"&gt;DS220j&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;2 x 12TB NAS&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;$997&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;83&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;1.1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="has-text-align-center" data-align="center"&gt;DS120j&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;1 x 12TB NAS&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;$578&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;48&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;0.83&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="has-text-align-center" data-align="center"&gt;WD Elements&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;1 x 12TB USB&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;$580&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;48&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;0.67&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="has-text-align-center" data-align="center"&gt;Seagate&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;1 x 12TB USB&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;$423&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;35&lt;/td&gt;&lt;td class="has-text-align-center" data-align="center"&gt;0.83&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Clearly out of the first two options, you&amp;rsquo;d choose the second. $2 extra per TB of storage is easily worth it to start with a new NAS compared with an eleven year old one. After that the price per TB doesn&amp;rsquo;t go down till you hit the single drive devices.&lt;/p&gt;
&lt;p&gt;Someone else may well start with different assumptions that I have made here, especially in the way I&amp;rsquo;ve decided to increase the drive quality as I&amp;rsquo;ve reduced the redundancy. For instance, you may be happy with a couple of second hand 12TB drives in a DS220j at $54/TB instead of rooting for new NAS drives. This would be along the lines of my original purchase of a DS216j and two 8TB second hand drives for $58/TB.&lt;/p&gt;
&lt;h2 id="the-plan"&gt;The Plan&lt;/h2&gt;
&lt;p&gt;Based on all this, I went with option two - the new DS420j and four old drives in a RAID6. It turned out a bit cheaper since there was a discount code for the NAS, and the price per drive was a touch less when buying four.&lt;/p&gt;
&lt;p&gt;For a local backup, I&amp;rsquo;ll use a single second hand 12TB drive in a DS120j, and for the remote, mainly because I want to share some storage with the home owner, and I feel that has to be on RAID, I&amp;rsquo;ll buy a pair of 14TB second hand drives to put in the DS216j for the remote, so I can open up a 2TB pool for them to use as a local backup for laptops or what have you.&lt;/p&gt;</description></item><item><title>External USB Drives in Linux</title><link>https://blog.iankulin.com/external-usb-drives-in-linux/</link><pubDate>Sat, 18 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/external-usb-drives-in-linux/</guid><description>&lt;p&gt;Many modern Linux distros will auto-mount USB drives - they just pop up in the graphical file manager as users would expect. When you&amp;rsquo;re running server, older, or smaller versions, that&amp;rsquo;s probably not going to be the case, and you&amp;rsquo;ll have to do it old school.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s look at some basics. &lt;code&gt;[lsblk](https://man7.org/linux/man-pages/man8/lsblk.8.html)&lt;/code&gt; will list the &amp;lsquo;block&amp;rsquo; devices. Your output will almost certainly be a bit different than this.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:~# lsblk
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sda 8:0 0 119.2G 0 disk 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├─sda1 8:1 0 1007K 0 part 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├─sda2 8:2 0 512M 0 part /boot/efi
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;└─sda3 8:3 0 118.7G 0 part 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-swap 253:0 0 7.7G 0 lvm [SWAP]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-root 253:1 0 39.8G 0 lvm /
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-data_tmeta 253:2 0 1G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ └─pve-data-tpool 253:4 0 54.6G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-data 253:5 0 54.6G 1 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-vm--100--disk--0 253:6 0 10G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-vm--101--disk--0 253:7 0 10G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-vm--300--disk--0 253:8 0 8G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-vm--102--disk--0 253:9 0 4M 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ └─pve-vm--102--disk--1 253:10 0 32G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └─pve-data_tdata 253:3 0 54.6G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └─pve-data-tpool 253:4 0 54.6G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-data 253:5 0 54.6G 1 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-vm--100--disk--0 253:6 0 10G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-vm--101--disk--0 253:7 0 10G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-vm--300--disk--0 253:8 0 8G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-vm--102--disk--0 253:9 0 4M 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └─pve-vm--102--disk--1 253:10 0 32G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you look at the &lt;code&gt;type&lt;/code&gt; column, you can see this machine has one &lt;em&gt;disk&lt;/em&gt;, with three &lt;em&gt;partitions&lt;/em&gt;, and the last partition has a heap of &lt;em&gt;logical volumes&lt;/em&gt;. Let&amp;rsquo;s plug the thumb drive in:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:~# lsblk
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sda 8:0 0 119.2G 0 disk 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├─sda1 8:1 0 1007K 0 part 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├─sda2 8:2 0 512M 0 part /boot/efi
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;└─sda3 8:3 0 118.7G 0 part 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-swap 253:0 0 7.7G 0 lvm [SWAP]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-root 253:1 0 39.8G 0 lvm /
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-data_tmeta 253:2 0 1G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ └─pve-data-tpool 253:4 0 54.6G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-data 253:5 0 54.6G 1 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-vm--100--disk--0 253:6 0 10G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-vm--101--disk--0 253:7 0 10G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-vm--300--disk--0 253:8 0 8G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ ├─pve-vm--102--disk--0 253:9 0 4M 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; │ └─pve-vm--102--disk--1 253:10 0 32G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └─pve-data_tdata 253:3 0 54.6G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └─pve-data-tpool 253:4 0 54.6G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-data 253:5 0 54.6G 1 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-vm--100--disk--0 253:6 0 10G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-vm--101--disk--0 253:7 0 10G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-vm--300--disk--0 253:8 0 8G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ├─pve-vm--102--disk--0 253:9 0 4M 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; └─pve-vm--102--disk--1 253:10 0 32G 0 lvm 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sdb 8:16 1 14.5G 0 disk 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;└─sdb1 8:17 1 14.5G 0 part 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There we are, down the bottom. Our disk is &lt;code&gt;sdb&lt;/code&gt;, and partition is &lt;code&gt;sdb1&lt;/code&gt;. So the OS knows it exists - it&amp;rsquo;s recognised, but to use it we need to &lt;code&gt;mount&lt;/code&gt; it to the file system somewhere. Mounting it will let us see and interact with the files on the drive.&lt;/p&gt;
&lt;p&gt;By convention, removable media is often mounted in &lt;code&gt;/media&lt;/code&gt; or &lt;code&gt;/mnt&lt;/code&gt;, but it can be wherever you like. Let&amp;rsquo;s make a directory for it in &lt;code&gt;/media&lt;/code&gt; and mount it there.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# mkdir /media/external
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# mount /dev/sdb1 /media/external
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# ls /media/external
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;02 Advance Australia Fair 1 verse vocal.mp3&amp;#39; &amp;#39;Year 3 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;Araw ng Kasarinl&amp;#39;$&amp;#39;\341&amp;#39;&amp;#39;n.mp4&amp;#39;	 &amp;#39;Year 4 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;System Volume Information&amp;#39;		 &amp;#39;Year 5 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;Year 1 Pack.pdf&amp;#39;			 &amp;#39;Year 6 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;Year 2 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Success!&lt;/p&gt;
&lt;p&gt;If we do the lsblk again, you&amp;rsquo;ll see out mount point in the listing&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# lsblk
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sda 8:0 0 119.2G 0 disk 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├─sda1 8:1 0 1007K 0 part 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├─sda2 8:2 0 512M 0 part /boot/efi
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;└─sda3 8:3 0 118.7G 0 part 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;sdb 8:16 1 14.5G 0 disk 
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;└─sdb1 8:17 1 14.5G 0 part /media/external
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Of course, just as in Windows, we need to tell the OS when we want to remove a removable drive to ensure that any caches are flushed and that we don&amp;rsquo;t inadvertently lose data when we yank it out. This is the &lt;em&gt;unmounting&lt;/em&gt; process.&lt;/p&gt;
&lt;p&gt;We can unmount a drive with the &lt;code&gt;[umount](https://man7.org/linux/man-pages/man8/umount.8.html)&lt;/code&gt; command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# ls /media/external
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;02 Advance Australia Fair 1 verse vocal.mp3&amp;#39; &amp;#39;Year 3 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;Araw ng Kasarinl&amp;#39;$&amp;#39;\341&amp;#39;&amp;#39;n.mp4&amp;#39;	 &amp;#39;Year 4 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;System Volume Information&amp;#39;		 &amp;#39;Year 5 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;Year 1 Pack.pdf&amp;#39;			 &amp;#39;Year 6 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;#39;Year 2 Pack.pdf&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# umount /media/external
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# ls /media/external
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;root@pve:/# 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Proxmox - Storage Basics</title><link>https://blog.iankulin.com/proxmox-storage-basics/</link><pubDate>Fri, 03 Feb 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/proxmox-storage-basics/</guid><description>&lt;p&gt;Once you&amp;rsquo;ve got Proxmox installed, you can point your web browser at the IP for the physical server, and use the port 8006. Log in as &lt;code&gt;root&lt;/code&gt; using the password you entered during the install. If you just accepted all the defaults during the install it will look something like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-7.52.16-pm.png" alt=""&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s discuss what you&amp;rsquo;re seeing in that &amp;lsquo;Server View&amp;rsquo; on the left there. &lt;code&gt;pve&lt;/code&gt; is the name of my &lt;em&gt;node&lt;/em&gt; - this installation of Proxmox on my physical server. If you named your server something different during the install, it will be show that name here.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Datacenter&lt;/code&gt; is just the idea of a container for all your nodes. I just have the one node, but if I had another physical server and set it up with Proxmox, it could be configured to appear in this dashboard along with my first node.&lt;/p&gt;
&lt;p&gt;Looking at my node, &lt;code&gt;pve&lt;/code&gt;, it has two storage items. Both are &amp;rsquo;local&amp;rsquo; which means they are physically on this machine. A common setup would be to have a Network Attached Storage (NAS) and have Proxmox use that for the Virtual Machine (VM) images. A big benefit of that would be the ability to move the VMs between nodes (physical servers) in your datacentre if needed - for example if a server failed.&lt;/p&gt;
&lt;p&gt;Since I only have local storage, you might be wondering why the installer set me up with two. Let&amp;rsquo;s click on the first one &lt;code&gt;local (pve)&lt;/code&gt; and look at the summary for it.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-8.14.04-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;So we can see in the summary at the right, that the type of this storage is &amp;lsquo;Directory&amp;rsquo;. Meaning that this is just a directory in the host (internally, Proxmox is just a specialised Linux distribution - in theory we could drop in to bash and look at this directory).&lt;/p&gt;
&lt;p&gt;The summary helpfully tells us the content for this storage as well, saying &lt;code&gt;VZDump backup file, ISO image, Container template&lt;/code&gt;. These are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;VZDump backup file - backups of VMs or containers&lt;/li&gt;
&lt;li&gt;ISO image - the images that VMs are created from&lt;/li&gt;
&lt;li&gt;Container template - images that containers are created from. For the moment, you can just imagine containers as lightweight VMs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can see from the graph that I&amp;rsquo;ve used a bit of this storage already. That because I have some ISO&amp;rsquo;s and container templates already downloaded to play with for the next post and stored in the local directory type storage.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s click on the other storage &lt;code&gt;local-lmv (pve)&lt;/code&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-8.28.41-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-01-26-at-8.28.41-pm.png" width="999" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We already discussed the &lt;code&gt;local&lt;/code&gt; part of the name &lt;code&gt;local-lvm (pre)&lt;/code&gt; means it&amp;rsquo;s on this machine/node. LVM stands for Logical Volume Manager. An LVM is an abstraction from the physical disk. A single LMV might actually be made of of a number of physical partitions, or even drives. Regardless of this, and LVM presents as a single volume at the software layer.&lt;/p&gt;
&lt;p&gt;This storage is used for disk for the VMs we&amp;rsquo;ll be running. If you look at the use graph, you can see that about 45 minutes ago, I had been using 10GB. That&amp;rsquo;s because I had a VM and a couple of containers configured. When I created them, part of that process is to specify how much disk storage each VM is allowed to use. Then that allocation is stored here.&lt;/p&gt;
&lt;p&gt;You can see in the summary, that the type of this storage is &lt;code&gt;LVM-Thin&lt;/code&gt;. The Thin part of this description means that although a hunk of storage is allocated, if it&amp;rsquo;s not actually used, then it&amp;rsquo;s still available to be allocated. For example, if you have a 100GB LVM, then you allocate 50GB to a VM, then on this display, you&amp;rsquo;ll see that 50 has been used up. But if the VM is only actually using 5GB, you&amp;rsquo;ll still effectively have 95GB to allocate.&lt;/p&gt;
&lt;p&gt;This is a great idea, until those VM&amp;rsquo;s &lt;em&gt;do&lt;/em&gt; start using up most of their allocation, because at that point the VM&amp;rsquo;s will start getting IO errors. Of course, since it&amp;rsquo;s an LVM, you&amp;rsquo;ll be able to add more storage to it before that happens if you&amp;rsquo;re keeping an eye on it. Thin provisioning was invented for companies that sell virtual server services. Their customers rarely use 100% of the hard disk space they pay for, so it&amp;rsquo;s highly profitable to use thin provisioning of storage and resell the same disk space multiple times.&lt;/p&gt;</description></item></channel></rss>