* btrfs-tools missing "btrfs device delete devid=x path" ?
@ 2014-03-23 15:25 Marc MERLIN
2014-03-23 16:18 ` Hugo Mills
0 siblings, 1 reply; 5+ messages in thread
From: Marc MERLIN @ 2014-03-23 15:25 UTC (permalink / raw)
To: linux-btrfs
I'm still doing some testing so that I can write some howto.
I got that far after a rebalance (mmmh, that took 2 days with little
data, and unfortunately 5 deadlocks and reboots.
polgara:/mnt/btrfs_backupcopy# btrfs fi show
Label: backupcopy uuid: eed9b55c-1d5a-40bf-a032-1be6980648e1
Total devices 11 FS bytes used 114.35GiB
devid 1 size 465.76GiB used 32.14GiB path /dev/dm-0
devid 2 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdd1
devid 3 size 465.75GiB used 0.00 path <---- drive is freed up now.
devid 4 size 465.76GiB used 32.14GiB path /dev/dm-2
devid 5 size 465.76GiB used 32.14GiB path /dev/dm-3
devid 6 size 465.76GiB used 32.14GiB path /dev/dm-4
devid 7 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdi1
devid 8 size 465.76GiB used 32.14GiB path /dev/dm-6
devid 9 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdk1
devid 10 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdl1
devid 11 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sde1
Btrfs v3.12
What's the syntax for removing a drive that isn't there?
I'm looking for something like
polgara:/mnt/btrfs_backupcopy# btrfs device delete devid=3 .
ERROR: error removing the device 'devid=3' - No such file or directory
Until I can remove it, not surprisingly, even though device 3 is now
unused, I still need to mount degraded:
polgara:~# mount -v -t btrfs -o compress=zlib,space_cache,noatime LABEL=backupcopy /mnt/btrfs_backupcopy
mount: wrong fs type, bad option, bad superblock on /dev/mapper/crypt_sde1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
[28865.527656] BTRFS: open devid=3 failed
[29777.507022] BTRFS: device label backupcopy devid 11 transid 5137 /dev/mapper/crypt_sde1
[29777.558874] BTRFS info (device dm-9): disk space caching is enabled
[29777.566997] BTRFS: failed to read chunk tree on dm-9
[29777.612041] BTRFS: open_ctree failed
polgara:~# mount -v -t btrfs -o compress=zlib,space_cache,noatime,degraded LABEL=backupcopy /mnt/btrfs_backupcopy
/dev/mapper/crypt_sde1 on /mnt/btrfs_backupcopy type btrfs (rw,noatime,compress=zlib,space_cache,degraded)
polgara:~#
This works.
I think if I get that last step working, I will have succcessfully removed a raid5
drive, added a new drive, rebalanced existing data on it, and removed the old one.
Thanks,
Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 1024R/763BE901
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: btrfs-tools missing "btrfs device delete devid=x path" ?
2014-03-23 15:25 btrfs-tools missing "btrfs device delete devid=x path" ? Marc MERLIN
@ 2014-03-23 16:18 ` Hugo Mills
2014-03-23 16:25 ` Marc MERLIN
0 siblings, 1 reply; 5+ messages in thread
From: Hugo Mills @ 2014-03-23 16:18 UTC (permalink / raw)
To: Marc MERLIN; +Cc: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 1667 bytes --]
On Sun, Mar 23, 2014 at 08:25:17AM -0700, Marc MERLIN wrote:
> I'm still doing some testing so that I can write some howto.
>
> I got that far after a rebalance (mmmh, that took 2 days with little
> data, and unfortunately 5 deadlocks and reboots.
>
> polgara:/mnt/btrfs_backupcopy# btrfs fi show
> Label: backupcopy uuid: eed9b55c-1d5a-40bf-a032-1be6980648e1
> Total devices 11 FS bytes used 114.35GiB
> devid 1 size 465.76GiB used 32.14GiB path /dev/dm-0
> devid 2 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdd1
> devid 3 size 465.75GiB used 0.00 path <---- drive is freed up now.
> devid 4 size 465.76GiB used 32.14GiB path /dev/dm-2
> devid 5 size 465.76GiB used 32.14GiB path /dev/dm-3
> devid 6 size 465.76GiB used 32.14GiB path /dev/dm-4
> devid 7 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdi1
> devid 8 size 465.76GiB used 32.14GiB path /dev/dm-6
> devid 9 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdk1
> devid 10 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdl1
> devid 11 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sde1
> Btrfs v3.12
>
> What's the syntax for removing a drive that isn't there?
btrfs dev del missing /path
Removes all the missing devices.
Hugo.
--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- Anyone using a computer to generate random numbers is, of ---
course, in a state of sin.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: btrfs-tools missing "btrfs device delete devid=x path" ?
2014-03-23 16:18 ` Hugo Mills
@ 2014-03-23 16:25 ` Marc MERLIN
2014-03-24 18:38 ` Duncan
0 siblings, 1 reply; 5+ messages in thread
From: Marc MERLIN @ 2014-03-23 16:25 UTC (permalink / raw)
To: Hugo Mills, linux-btrfs
On Sun, Mar 23, 2014 at 04:18:43PM +0000, Hugo Mills wrote:
> On Sun, Mar 23, 2014 at 08:25:17AM -0700, Marc MERLIN wrote:
> > I'm still doing some testing so that I can write some howto.
> >
> > I got that far after a rebalance (mmmh, that took 2 days with little
> > data, and unfortunately 5 deadlocks and reboots.
> >
> > polgara:/mnt/btrfs_backupcopy# btrfs fi show
> > Label: backupcopy uuid: eed9b55c-1d5a-40bf-a032-1be6980648e1
> > Total devices 11 FS bytes used 114.35GiB
> > devid 1 size 465.76GiB used 32.14GiB path /dev/dm-0
> > devid 2 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdd1
> > devid 3 size 465.75GiB used 0.00 path <---- drive is freed up now.
> > devid 4 size 465.76GiB used 32.14GiB path /dev/dm-2
> > devid 5 size 465.76GiB used 32.14GiB path /dev/dm-3
> > devid 6 size 465.76GiB used 32.14GiB path /dev/dm-4
> > devid 7 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdi1
> > devid 8 size 465.76GiB used 32.14GiB path /dev/dm-6
> > devid 9 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdk1
> > devid 10 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sdl1
> > devid 11 size 465.76GiB used 32.14GiB path /dev/mapper/crypt_sde1
> > Btrfs v3.12
> >
> > What's the syntax for removing a drive that isn't there?
>
> btrfs dev del missing /path
>
> Removes all the missing devices.
Aaah, this worked, thank you.
This isn't documented in the 3.12 man page, but I'm guessing it'll be in
the upcoming 3.14.
I'll document this in the raid5 page I'm currently writing.
Thanks,
Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 1024R/763BE901
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: btrfs-tools missing "btrfs device delete devid=x path" ?
2014-03-23 16:25 ` Marc MERLIN
@ 2014-03-24 18:38 ` Duncan
2014-03-24 22:04 ` Marc MERLIN
0 siblings, 1 reply; 5+ messages in thread
From: Duncan @ 2014-03-24 18:38 UTC (permalink / raw)
To: linux-btrfs
Marc MERLIN posted on Sun, 23 Mar 2014 09:25:06 -0700 as excerpted:
> On Sun, Mar 23, 2014 at 04:18:43PM +0000, Hugo Mills wrote:
>> On Sun, Mar 23, 2014 at 08:25:17AM -0700, Marc MERLIN wrote:
>>>
>>> What's the syntax for removing a drive that isn't there?
>>
>> btrfs dev del missing /path
>>
>> Removes all the missing devices.
>
> Aaah, this worked, thank you.
> This isn't documented in the 3.12 man page, but I'm guessing it'll be in
> the upcoming 3.14.
>
> I'll document this in the raid5 page I'm currently writing.
It's on the wiki as I remembered, covered on the multiple devices page.
https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Removing_devices
(FWIW it's pretty safe to say that if it was in the wiki, at least in
the user docs section, I saw it before I ever did my first mkfs.btrfs,
as I pretty much scoured the wiki, then asked some questions not covered
there here as well, before I actually tried to use it. Unlike some people
I actually tend to read the instructions before trying to use stuff I buy,
too. =:^)
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: btrfs-tools missing "btrfs device delete devid=x path" ?
2014-03-24 18:38 ` Duncan
@ 2014-03-24 22:04 ` Marc MERLIN
0 siblings, 0 replies; 5+ messages in thread
From: Marc MERLIN @ 2014-03-24 22:04 UTC (permalink / raw)
To: Duncan; +Cc: linux-btrfs
On Mon, Mar 24, 2014 at 06:38:30PM +0000, Duncan wrote:
> Marc MERLIN posted on Sun, 23 Mar 2014 09:25:06 -0700 as excerpted:
>
> > On Sun, Mar 23, 2014 at 04:18:43PM +0000, Hugo Mills wrote:
> >> On Sun, Mar 23, 2014 at 08:25:17AM -0700, Marc MERLIN wrote:
> >>>
> >>> What's the syntax for removing a drive that isn't there?
> >>
> >> btrfs dev del missing /path
> >>
> >> Removes all the missing devices.
> >
> > Aaah, this worked, thank you.
> > This isn't documented in the 3.12 man page, but I'm guessing it'll be in
> > the upcoming 3.14.
> >
> > I'll document this in the raid5 page I'm currently writing.
>
> It's on the wiki as I remembered, covered on the multiple devices page.
> https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices#Removing_devices
So, I did read the entire wiki, but it's been a while, and either some
things got added since then, or some I just didn't remember because I didn't
need them at the time.
The problem, and we've talked about this before (my plea to make btrfsck put
a "--really-I-read-the-wiki-and-want-this" :) option as well as minimal
instructions in its usage that tell the unsuspecting user it's not what
they're looking for, here too, I carefully re-read the man page for btrfs
and this wasn't mentioned in it, or at least in my copy.
Out of sync docs happens, but I'm hopeful that the man page and tools --help
info can be the canonical place for info, even if they can point to a wiki
link since the average admin will always fail back to --help/--usage and the
man page first before looking for a missing option in a wiki somewhere else.
Does that sound reasonable?
Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-03-24 22:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-23 15:25 btrfs-tools missing "btrfs device delete devid=x path" ? Marc MERLIN
2014-03-23 16:18 ` Hugo Mills
2014-03-23 16:25 ` Marc MERLIN
2014-03-24 18:38 ` Duncan
2014-03-24 22:04 ` Marc MERLIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox