linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] New 'btrfs chunk list' command
@ 2014-11-25 15:57 Goffredo Baroncelli
  2014-11-25 15:57 ` [PATCH 1/4] Move group_type_str() and group_profile_str() Goffredo Baroncelli
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Goffredo Baroncelli @ 2014-11-25 15:57 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

This is a revamp of a my previous patches set[1]. After more than
year of attempts these patches were never merged, so I tried to
simplify them and to change a bit the focus. The previous patches set
had the focus to the disk usage.
The aim of these patches now is to show the chunks distribution
among the disks. So a new command 'btrfs chunk list' is added:

$ sudo ./btrfs chunk list /mnt/btrfs1/
Data,RAID6: Size:3.00GiB, Used:1.02MiB
   /dev/vdb	   1.00GiB
   /dev/vdd	   1.00GiB
   /dev/vde	   1.00GiB
   /dev/vdf	   1.00GiB
   /dev/vdg	   1.00GiB

Metadata,RAID5: Size:1.00GiB, Used:112.00KiB
   /dev/vdb	 256.00MiB
   /dev/vdd	 256.00MiB
   /dev/vde	 256.00MiB
   /dev/vdf	 256.00MiB
   /dev/vdg	 256.00MiB

System,RAID1: Size:32.00MiB, Used:16.00KiB
   /dev/vde	  32.00MiB
   /dev/vdg	  32.00MiB

Unallocated:
   /dev/vdb	  48.75GiB
   /dev/vdd	  48.75GiB
   /dev/vde	  48.72GiB
   /dev/vdf	  48.75GiB
   /dev/vdg	  48.72GiB


This command is smart enough to highlight that a disk is not preset
(this happens when a mount -o degraded is used). In case 
/dev/vdb disappears:

$ sudo ./btrfs chunk list /mnt/btrfs1/
Data,RAID6: Size:3.00GiB, Used:1.02MiB
   /dev/vdb	   1.00GiB
   /dev/vde	   1.00GiB
   /dev/vdf	   1.00GiB
   /dev/vdg	   1.00GiB
   [Missing: /dev/vdd]	   1.00GiB

Metadata,RAID5: Size:1.00GiB, Used:112.00KiB
   /dev/vdb	 256.00MiB
   /dev/vde	 256.00MiB
   /dev/vdf	 256.00MiB
   /dev/vdg	 256.00MiB
   [Missing: /dev/vdd]	 256.00MiB

System,RAID1: Size:32.00MiB, Used:16.00KiB
   /dev/vde	  32.00MiB
   /dev/vdg	  32.00MiB

Unallocated:
   /dev/vdb	  48.75GiB
   /dev/vde	  48.72GiB
   /dev/vdf	  48.75GiB
   /dev/vdg	  48.72GiB
   [Missing: /dev/vdd]	  48.75GiB


It is interesting to see what happens after a 
'btrfs balance':

$ sudo ./btrfs chunk list /mnt/btrfs1/
Data,RAID6: Size:2.00GiB, Used:792.00KiB
   /dev/vdb	   1.00GiB
   /dev/vde	   1.00GiB
   /dev/vdf	   1.00GiB
   /dev/vdg	   1.00GiB

Metadata,RAID5: Size:1.03GiB, Used:112.00KiB
   /dev/vdb	 352.00MiB
   /dev/vde	 352.00MiB
   /dev/vdf	 352.00MiB
   /dev/vdg	 352.00MiB

System,RAID1: Size:32.00MiB, Used:16.00KiB
   /dev/vdb	  32.00MiB
   /dev/vdf	  32.00MiB

Unallocated:
   /dev/vdb	  48.63GiB
   /dev/vde	  48.66GiB
   /dev/vdf	  48.63GiB
   /dev/vdg	  48.66GiB
   [Missing: /dev/vdd]	  50.00GiB

And what happens after a 'btrfs device delete missing':

$ sudo ./btrfs chunk list /mnt/btrfs1/
Data,RAID6: Size:2.00GiB, Used:792.00KiB
   /dev/vdb	   1.00GiB
   /dev/vde	   1.00GiB
   /dev/vdf	   1.00GiB
   /dev/vdg	   1.00GiB

Metadata,RAID5: Size:1.03GiB, Used:112.00KiB
   /dev/vdb	 352.00MiB
   /dev/vde	 352.00MiB
   /dev/vdf	 352.00MiB
   /dev/vdg	 352.00MiB

System,RAID1: Size:32.00MiB, Used:16.00KiB
   /dev/vdb	  32.00MiB
   /dev/vdf	  32.00MiB

Unallocated:
   /dev/vdb	  48.63GiB
   /dev/vde	  48.66GiB
   /dev/vdf	  48.63GiB
   /dev/vdg	  48.66GiB

Comments are welcome.
BR
G.Baroncelli



[1] My last attempt was done in 
http://comments.gmane.org/gmane.comp.file-systems.btrfs/32647,
then David resent the patches in 
http://www.spinics.net/lists/linux-btrfs/msg33630.html


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-11-25 17:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 15:57 [PATCH 0/4] New 'btrfs chunk list' command Goffredo Baroncelli
2014-11-25 15:57 ` [PATCH 1/4] Move group_type_str() and group_profile_str() Goffredo Baroncelli
2014-11-25 15:57 ` [PATCH 2/4] Add the code for the btrfs chunk list command Goffredo Baroncelli
2014-11-25 15:57 ` [PATCH 3/4] Add " Goffredo Baroncelli
2014-11-25 15:57 ` [PATCH 4/4] Add man page for the 'btrfs chunk' family commands Goffredo Baroncelli
2014-11-25 16:08 ` [PATCH 0/4] New 'btrfs chunk list' command Martin Steigerwald
2014-11-25 17:10   ` Goffredo Baroncelli
2014-11-25 17:41     ` David Sterba
2014-11-25 16:13 ` David Sterba
2014-11-25 17:06   ` Goffredo Baroncelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).