@@ -57,6 +57,107 @@ Now we are ready to mount that directory as volume in Varasto! From Varasto choo
5757That's it! Now that the volume is mounted, Varasto can write files there.
5858
5959
60+ Adding new disk to Varasto
61+ --------------------------
62+
63+ These instructions are for Linux. You can do the same on easily Windows, but you'll have to improvise.
64+
65+ NOTE: Many of the commands might need ` $ sudo ` prefix.
66+
67+
68+ ### Partition your drive
69+
70+ If your drive isn't already partitioned (or you want to inspect the partition table):
71+
72+ ``` bash
73+ $ fdisk /dev/sdn
74+ ```
75+
76+ (FIXME: you probably need to use gdisk, since fdisk by default tried to give me partition with 2 TB size for a 16+ TB disk:
77+ https://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html )
78+
79+ While you could in theory use the full block device without partitioning if all you need
80+ is a single partition, it might be a good idea to partition anyway to have less exotic setup.
81+ Recovery situations are always easier the more standard your setup is.
82+
83+
84+ ### Format the partition for ext4
85+
86+ ``` bash
87+ $ mkfs.ext4 -L wernstrom -m 1 /dev/sdn1
88+ ```
89+
90+ The ` -m ` sets [ reserved blocks] ( https://wiki.archlinux.org/index.php/Ext4#Reserved_blocks )
91+ to ` 1 % ` instead of the default (5 %). The default would leave quite a lot of space
92+ unusable for larger drives.
93+
94+ TODO: openable why-section
95+
96+ Reserved blocks mechanism doesn't benefit Varasto-managed partitions because
97+ the mechanism is designed for quite different use case.
98+
99+
100+ ### Make a mount point for the drive
101+
102+ Linux needs an empty directory as a placeholder for a mount point.
103+
104+ ``` bash
105+ $ mkdir /mnt/varasto/wernstrom
106+ ```
107+
108+
109+ ### Add volume to fstab for automatic mounting on reboots
110+
111+ ``` bash
112+ $ vim /etc/fstab
113+ ```
114+
115+ Let's assume you already have a volume named ` amy ` . You're now adding ` wernstrom ` . The
116+ lines now look like this:
117+
118+ ```
119+ LABEL=amy /mnt/varasto/amy ext4 defaults,nofail,noatime 0 1
120+ LABEL=wernstrom /mnt/varasto/wernstrom ext4 defaults,nofail,noatime 0 1
121+ ```
122+
123+ ### Mount the new partition
124+
125+ Currently, your block device partition is not mounted:
126+
127+ ``` bash
128+ $ lsblk
129+ sdn 8:208 0 10,9T 0 disk
130+ └─sdn1 8:209 0 10,9T 0 part
131+ ```
132+
133+ You can either restart your system to see that the auto-mounting (` /etc/fstab ` ) works, or
134+ you can trigger a command to mount all the ` fstab-mentioned ` partitions now:
135+
136+
137+ ``` bash
138+ $ mount --all
139+ $ lsblk
140+ sdn 8:208 0 10,9T 0 disk
141+ └─sdn1 8:209 0 10,9T 0 part /mnt/varasto/wernstrom
142+ ```
143+
144+ Decide quota for Varasto
145+ ------------------------
146+
147+ Varasto allows you to manage quota for each volume. Find out how much space your partition has:
148+
149+ ``` bash
150+ $ df --block-size=1 /mnt/varasto/wernstrom
151+ Filesystem 1B-blocks Used Available Use% Mounted on
152+ /dev/sdn1 11904442871808 128673338328 11775769533480 1% /mnt/varasto/wernstrom
153+ ```
154+
155+ The output is in bytes. In Varasto you enter quota in MiB.
156+
157+ My volume after formatting has 10.71... TiB free, so I will round that down a bit and use
158+ 11010048 MiB (10.5 TiB = 11010048 / 1024 / 1024) as my quota. I can increase the quota later.
159+
160+
60161Do I need a dedicated partition for Varasto volume?
61162---------------------------------------------------
62163
0 commit comments