" --keys-from-stdin Read passphrases from stdin\n"
" --listen Listen for remote commands\n"
" --live Connect to a live virtual machine\n"
- " -m|--mount dev[:mnt] Mount dev on mnt (if omitted, /)\n"
+ " -m|--mount dev[:mnt[:opts]] Mount dev on mnt (if omitted, /)\n"
" -n|--no-sync Don't autosync\n"
" -N|--new type Create prepared disk (test1.img, ...)\n"
" --progress-bars Enable progress bars even when not interactive\n"
Connect to a live virtual machine.
(Experimental, see L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>).
-=item B<-m dev[:mountpoint]>
+=item B<-m dev[:mountpoint[:options]]>
-=item B<--mount dev[:mountpoint]>
+=item B<--mount dev[:mountpoint[:options]]>
Mount the named partition or logical volume on the given mountpoint.
L</list-filesystems> and L</lvs> commands), or you can use the
L<virt-filesystems(1)> program.
-Using this flag is mostly equivalent to using the C<mount-options>
-command or the C<mount-ro> command if the I<--ro> flag was given.
+The third (and rarely used) part of the mount parameter is the list of
+mount options used to mount the underlying filesystem. If this is not
+given, then the mount options are either the empty string or C<ro>
+(the latter if the I<--ro> flag is used). By specifying the mount
+options, you override this default choice. Probably the only time you
+would use this is to enable ACLs and/or extended attributes if the
+filesystem can support them:
+
+ -m /dev/sda1:/:acl,user_xattr
+
+Using this flag is equivalent to using the C<mount-options> command.
=item B<-n>
/* libguestfs - guestfish and guestmount shared option parsing
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (mp) {
mount_mps (mp->next);
+ const char *options;
+ if (mp->options)
+ options = mp->options;
+ else if (read_only)
+ options = "ro";
+ else
+ options = "";
+
/* Don't use guestfs_mount here because that will default to mount
* options -o sync,noatime. For more information, see guestfs(3)
* section "LIBGUESTFS GOTCHAS".
*/
- const char *options = read_only ? "ro" : "";
r = guestfs_mount_options (g, options, mp->device, mp->mountpoint);
if (r == -1) {
/* Display possible mountpoints before exiting. */
/* libguestfs - guestfish and guestmount shared option parsing
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
struct mp *next;
char *device;
char *mountpoint;
+ char *options;
};
/* in inspect.c */
perror ("malloc"); \
exit (EXIT_FAILURE); \
} \
+ mp->options = NULL; \
+ mp->mountpoint = bad_cast ("/"); \
p = strchr (optarg, ':'); \
if (p) { \
*p = '\0'; \
- mp->mountpoint = p+1; \
- } else \
- mp->mountpoint = bad_cast ("/"); \
+ p++; \
+ mp->mountpoint = p; \
+ p = strchr (p, ':'); \
+ if (p) { \
+ *p = '\0'; \
+ p++; \
+ mp->options = p; \
+ } \
+ } \
mp->device = optarg; \
mp->next = mps; \
mps = mp
Connect to a live virtual machine.
(Experimental, see L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>).
-=item B<-m dev[:mnt]> | B<--mount dev[:mnt]>
+=item B<-m dev[:mountpoint[:options]]>
+
+=item B<--mount dev[:mountpoint[:options]]>
Mount the named partition or logical volume on the given mountpoint
B<in the guest> (this has nothing to do with mountpoints in the host).
If the mountpoint is omitted, it defaults to C</>. You have to mount
something on C</>.
+The third (and rarely used) part of the mount parameter is the list of
+mount options used to mount the underlying filesystem. If this is not
+given, then the mount options are either the empty string or C<ro>
+(the latter if the I<--ro> flag is used). By specifying the mount
+options, you override this default choice. Probably the only time you
+would use this is to enable ACLs and/or extended attributes if the
+filesystem can support them:
+
+ -m /dev/sda1:/:acl,user_xattr
+
=item B<-n> | B<--no-sync>
By default, we attempt to sync the guest disk when the FUSE mountpoint