btrfs-progs: let user know that devid can be used if path is missing
authorAnand Jain <anand.jain@oracle.com>
Thu, 25 Jul 2013 17:35:26 +0000 (01:35 +0800)
committerDavid Sterba <dsterba@suse.cz>
Tue, 3 Sep 2013 17:40:51 +0000 (19:40 +0200)
When the device disappear the path goes missing,
and that will be the one of the reason that user
will replace the device.

The devid of the missing btrfs device can be
obtained using the new cli option
 btrfs fi show --kernel

And which can be used in the replace command.
---
btrfs replace start /dev/sdc /dev/sde /btrfs
Error: Unable to open device '/dev/sdc'
        Try using the devid instead of the path
---

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
cmds-replace.c

index e409e11..25e8c7f 100644 (file)
@@ -245,6 +245,7 @@ static int cmd_start_replace(int argc, char **argv)
                if (fdsrcdev < 0) {
                        fprintf(stderr, "Error: Unable to open device '%s'\n",
                                srcdev);
+                       fprintf(stderr, "\tTry using the devid instead of the path\n");
                        goto leave_with_error;
                }
                ret = fstat(fdsrcdev, &st);