Skip to contentSkip to conversation

explain filesystem resize devid option

PATCH New Hubert Kario 1 participant 1 message Feb 9, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 explain filesystem resize devid option

Adds explanation to help message and man page how to use `filesystem resize' to resize only a single device not all devices of a file system.

---
patch to apply cleanly requires my previous patches adding advanced help functionality

 btrfs.c        |   10 +++++++---
 man/btrfs.8.in |    6 ++++--
 2 files changed, 11 insertions(+), 5 deletions(-)
btrfs.c +7 -3
index bd6f6f8..a28a573 100644
@@ -98,10 +98,14 @@ static struct Command commands[] = {
           NULL
 	},
 	{ do_resize, 2,
-	  "filesystem resize", "[+/-]<newsize>[gkm]|max <filesystem>\n"
+	  "filesystem resize", "[<devid>:][+|-]<newsize>[gkm]|max <filesystem>\n"
 		"Resize the file system. If 'max' is passed, the filesystem\n"
-		"will occupe all available space on the device.",
-          NULL
+		"will occupy all available space on the device.",
+          "[<devid>:][+|-]<newsize>[gkm]|max <filesystem>\n"
+                "Resize the file system. If no <devid> is specified, change is\n"
+                "applied to every device in file system. If devid is specified\n"
+                "the change in size is applied only to selected device.\n"
+                "To get device numbers use `btrfs filesystem show\' command."
 	},
 	{ do_show_filesystem, 999,
 	  "filesystem show", "[<uuid>|<label>]\n"
man/btrfs.8.in +4 -2
index cba2de1..afb9824 100644
@@ -19,7 +19,7 @@ btrfs \- control a btrfs filesystem
 .PP
 \fBbtrfs\fP \fBfilesystem sync\fP\fI <path> \fP
 .PP
-\fBbtrfs\fP \fBfilesystem resize\fP\fI [+/\-]<size>[gkm]|max <filesystem>\fP
+\fBbtrfs\fP \fBfilesystem resize\fP\fI [<devid>:][+|\-]<size>[gkm]|max <filesystem>\fP
 .PP
 \fBbtrfs\fP \fBdevice scan\fP\fI [<device> [<device>..]]\fP
 .PP
@@ -138,9 +138,11 @@ Force a sync for the filesystem identified by \fI<path>\fR.
 .\" Some wording are extracted by the resize2fs man page
 .\"
 
-\fBfilesystem resize\fR\fI [+/\-]<size>[gkm]|max <path>\fR
+\fBfilesystem resize\fR\fI [<devid>:][+|\-]<size>[gkm]|max <path>\fR
 Resize a filesystem identified by \fI<path>\fR.
 The \fI<size>\fR parameter specifies the new size of the filesystem.
+To change size of only one device the device id can be specified before \fI:\fR.
+Device identifiers are printed by \fBfilesystem show\fR command.
 If the prefix \fI+\fR or \fI\-\fR is present the size is increased or decreased
 by the quantity \fI<size>\fR.
 If no units are specified, the unit of the \fI<size>\fR parameter defaults to
Signature · 1 line
1.7.4