linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.cz>
Subject: [PATCH 0/4] New 'btrfs chunk list' command
Date: Tue, 25 Nov 2014 16:57:21 +0100	[thread overview]
Message-ID: <1416931045-24259-1-git-send-email-kreijack@inwind.it> (raw)

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


             reply	other threads:[~2014-11-25 15:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 15:57 Goffredo Baroncelli [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416931045-24259-1-git-send-email-kreijack@inwind.it \
    --to=kreijack@gmail.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).