1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
<!-- NotesZfsHotSwappingMirrorsOnLivePools, Version: 1, Modified: 2018/12/02, Author: trac -->
# Hot swapping disks on live zfs pools
*HOLY FUCKING AWESOME!!!!*
Watch while I add a fresh disk as a mirror, resliver the pool and remove and repartition the original disk while the container using the pool is still running!!!
YOU ARE HERE - making this into a structured document
```sh
root@bs2020:~# zpool status
pool: lxd4dev
state: ONLINE
scan: scrub repaired 0 in 0h8m with 0 errors on Sun Aug 12 00:32:48 2018
config:
NAME STATE READ WRITE CKSUM
lxd4dev ONLINE 0 0 0
sdd1 ONLINE 0 0 0
sdf ONLINE 0 0 0
sde ONLINE 0 0 0
errors: No known data errors
pool: lxd4infra
state: ONLINE
scan: scrub repaired 0 in 0h2m with 0 errors on Sun Aug 12 00:27:02 2018
config:
NAME STATE READ WRITE CKSUM
lxd4infra ONLINE 0 0 0
sda1 ONLINE 0 0 0
errors: No known data errors
root@bs2020:~# zpool add -n lxd4infra mirror sdb
invalid vdev specification: mirror requires at least 2 devices
root@bs2020:~# zpool add -n lxd4infra mirror sda1 sdb
invalid vdev specification
use '-f' to override the following errors:
/dev/sda1 is part of active pool 'lxd4infra'
/dev/sdb does not contain an EFI label but it may contain partition
information in the MBR.
root@bs2020:~# mklabel GPT /dev/sdb
bash: mklabel: command not found
root@bs2020:~# parted /dev/sdb
bash: parted: command not found
root@bs2020:~# gparted /dev/sdb
bash: gparted: command not found
root@bs2020:~# zpool add -nf lxd4infra mirror sda1 sdb
invalid vdev specification
the following errors must be manually repaired:
/dev/sda1 is part of active pool 'lxd4infra'
root@bs2020:~# zpool add -nf lxd4infra mirror sdb sda1
invalid vdev specification
the following errors must be manually repaired:
/dev/sda1 is part of active pool 'lxd4infra'
root@bs2020:~# zpool add -nf lxd4infra mirror sdb
invalid vdev specification: mirror requires at least 2 devices
root@bs2020:~# zpool add -nf lxd4infra sda1 mirror sdb
invalid vdev specification: mirror requires at least 2 devices
root@bs2020:~# zpool attach -n sda1 sdb
invalid option 'n'
usage:
attach [-f] [-o property=value] <pool> <device> <new-device>
root@bs2020:~# zpool attach sda1 sdb
missing <new_device> specification
usage:
attach [-f] [-o property=value] <pool> <device> <new-device>
root@bs2020:~# zpool attach lxd4infra sda1 sdb
invalid vdev specification
use '-f' to override the following errors:
/dev/sdb does not contain an EFI label but it may contain partition
information in the MBR.
root@bs2020:~# gparted
bash: gparted: command not found
root@bs2020:~# parted
bash: parted: command not found
root@bs2020:~# apt-get install parted
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libparted2
Suggested packages:
libparted-dev libparted-i18n parted-doc
The following NEW packages will be installed:
libparted2 parted
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 158 kB of archives.
After this operation, 520 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libparted2 amd64 3.2-15ubuntu0.1 [115 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 parted amd64 3.2-15ubuntu0.1 [42.4 kB]
Fetched 158 kB in 0s (277 kB/s)
Selecting previously unselected package libparted2:amd64.
(Reading database ... 32152 files and directories currently installed.)
Preparing to unpack .../libparted2_3.2-15ubuntu0.1_amd64.deb ...
Unpacking libparted2:amd64 (3.2-15ubuntu0.1) ...
Selecting previously unselected package parted.
Preparing to unpack .../parted_3.2-15ubuntu0.1_amd64.deb ...
Unpacking parted (3.2-15ubuntu0.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libparted2:amd64 (3.2-15ubuntu0.1) ...
Setting up parted (3.2-15ubuntu0.1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
root@bs2020:~# parted /dev/sdb
GNU Parted 3.2
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel GPT
(parted) w
align-check TYPE N check partition N for TYPE(min|opt) alignment
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a particular
partition
quit exit program
rescue START END rescue a lost partition near START and END
resizepart NUMBER END resize partition NUMBER
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version display the version number and copyright information of GNU Parted
(parted) q
Information: You may need to update /etc/fstab.
root@bs2020:~# zpool attach lxd4infra sda1 sdb
root@bs2020:~# zpool status
pool: lxd4dev
state: ONLINE
scan: scrub repaired 0 in 0h8m with 0 errors on Sun Aug 12 00:32:48 2018
config:
NAME STATE READ WRITE CKSUM
lxd4dev ONLINE 0 0 0
sdd1 ONLINE 0 0 0
sdf ONLINE 0 0 0
sde ONLINE 0 0 0
errors: No known data errors
pool: lxd4infra
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scan: resilver in progress since Tue Sep 4 09:05:14 2018
182M scanned out of 5.38G at 10.7M/s, 0h8m to go
181M resilvered, 3.30% done
config:
NAME STATE READ WRITE CKSUM
lxd4infra ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sda1 ONLINE 0 0 0
sdb ONLINE 0 0 0 (resilvering)
errors: No known data errors
root@bs2020:~# packet_write_wait: Connection to 198.202.31.242: Broken pipe
steve:~ don$ ssh feurig@bs2020.suspectdevices.com
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-96-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 packages can be updated.
0 updates are security updates.
New release '18.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Tue Sep 4 08:26:28 2018 from 75.164.203.77
feurig@bs2020:~$ sudo bash
[sudo] password for feurig:
root@bs2020:~# packet_write_wait: Connection to 198.202.31.242: Broken pipe
steve:~ don$ ssh feurig@bs2020.suspectdevices.com
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-96-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 packages can be updated.
0 updates are security updates.
New release '18.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Wed Sep 5 16:10:53 2018 from 75.164.203.77
feurig@bs2020:~$ sudo bash
[sudo] password for feurig:
root@bs2020:~# packet_write_wait: Connection to 198.202.31.242: Broken pipe
steve:~ don$
steve:~ don$ ssh feurig@bs2020.suspectdevices.com
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-96-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 packages can be updated.
0 updates are security updates.
New release '18.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Wed Sep 5 18:56:14 2018 from 75.164.203.77
feurig@bs2020:~$ sudo bash
[sudo] password for feurig:
root@bs2020:~# zpool status
pool: lxd4dev
state: ONLINE
scan: scrub repaired 0 in 0h8m with 0 errors on Sun Aug 12 00:32:48 2018
config:
NAME STATE READ WRITE CKSUM
lxd4dev ONLINE 0 0 0
sdd1 ONLINE 0 0 0
sdf ONLINE 0 0 0
sde ONLINE 0 0 0
errors: No known data errors
pool: lxd4infra
state: ONLINE
scan: resilvered 5.38G in 0h6m with 0 errors on Tue Sep 4 09:11:31 2018
config:
NAME STATE READ WRITE CKSUM
lxd4infra ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sda1 ONLINE 0 0 0
sdb ONLINE 0 0 0
errors: No known data errors
root@bs2020:~# zpool detach -n lxd4infra sda1
invalid option 'n'
usage:
detach <pool> <device>
root@bs2020:~# zpool detach lxd4infra sda1
root@bs2020:~# zpool status
pool: lxd4dev
state: ONLINE
scan: scrub repaired 0 in 0h8m with 0 errors on Sun Aug 12 00:32:48 2018
config:
NAME STATE READ WRITE CKSUM
lxd4dev ONLINE 0 0 0
sdd1 ONLINE 0 0 0
sdf ONLINE 0 0 0
sde ONLINE 0 0 0
errors: No known data errors
pool: lxd4infra
state: ONLINE
scan: resilvered 5.38G in 0h6m with 0 errors on Tue Sep 4 09:11:31 2018
config:
NAME STATE READ WRITE CKSUM
lxd4infra ONLINE 0 0 0
sdb ONLINE 0 0 0
errors: No known data errors
root@bs2020:~# gparted /dev/sda
bash: gparted: command not found
root@bs2020:~# parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel GPT
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y
(parted) q
Information: You may need to update /etc/fstab.
root@bs2020:~# zpool status
pool: lxd4dev
state: ONLINE
scan: scrub repaired 0 in 0h8m with 0 errors on Sun Aug 12 00:32:48 2018
config:
NAME STATE READ WRITE CKSUM
lxd4dev ONLINE 0 0 0
sdd1 ONLINE 0 0 0
sdf ONLINE 0 0 0
sde ONLINE 0 0 0
errors: No known data errors
pool: lxd4infra
state: ONLINE
scan: resilvered 5.38G in 0h6m with 0 errors on Tue Sep 4 09:11:31 2018
config:
NAME STATE READ WRITE CKSUM
lxd4infra ONLINE 0 0 0
sdb ONLINE 0 0 0
errors: No known data errors
root@bs2020:~# zpool attach lxd4infra sdb sda
root@bs2020:~# zpool status
pool: lxd4dev
state: ONLINE
scan: scrub repaired 0 in 0h8m with 0 errors on Sun Aug 12 00:32:48 2018
config:
NAME STATE READ WRITE CKSUM
lxd4dev ONLINE 0 0 0
sdd1 ONLINE 0 0 0
sdf ONLINE 0 0 0
sde ONLINE 0 0 0
errors: No known data errors
pool: lxd4infra
state: ONLINE
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scan: resilver in progress since Thu Sep 6 09:24:09 2018
69.8M scanned out of 5.42G at 5.37M/s, 0h17m to go
67.9M resilvered, 1.26% done
config:
NAME STATE READ WRITE CKSUM
lxd4infra ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sdb ONLINE 0 0 0
sda ONLINE 0 0 0 (resilvering)
errors: No known data errors
root@bs2020:~#
```
|