summaryrefslogtreecommitdiffstats
path: root/mount/mount.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:53 +0100
committerKarel Zak2006-12-07 00:25:53 +0100
commitffc4374869b9ac10539a3c18e13b29d1b0c64484 (patch)
tree1b8054e83f7f70e8fa77499fc9246d1cc16faa15 /mount/mount.c
parentImported from util-linux-2.11n tarball. (diff)
downloadkernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.tar.gz
kernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.tar.xz
kernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.zip
Imported from util-linux-2.11o tarball.
Diffstat (limited to 'mount/mount.c')
-rw-r--r--mount/mount.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/mount/mount.c b/mount/mount.c
index 97b8aebba..dc10e64bb 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -467,7 +467,7 @@ guess_fstype_and_mount (char *spec, char *node, char **types,
*types = "none"; /* random, but not "bind" */
if (!*types && !(flags & MS_REMOUNT)) {
- *types = guess_fstype_from_superblock(spec);
+ *types = guess_fstype(spec);
if (*types && !strcmp(*types, "swap")) {
error(_("%s looks like swapspace - not mounted"), spec);
*types = NULL;
@@ -1312,6 +1312,7 @@ static struct option longopts[] = {
{ "before", 0, 0, 131 },
{ "over", 0, 0, 132 },
{ "move", 0, 0, 133 },
+ { "guess-fstype", 1, 0, 134 },
{ NULL, 0, 0, 0 }
};
@@ -1335,6 +1336,8 @@ usage (FILE *fp, int n) {
"a filesystem (of the given type) found on the device.\n"
"One can also mount an already visible directory tree elsewhere:\n"
" mount --bind olddir newdir\n"
+ "or move a subtree:\n"
+ " mount --move olddir newdir\n"
"A device can be given by name, say /dev/hda1 or /dev/cdrom,\n"
"or by label, using -L label or by uuid, using -U uuid .\n"
"Other options: [-nfFrsvw] [-o options].\n"
@@ -1375,7 +1378,7 @@ main (int argc, char *argv[]) {
#endif
while ((c = getopt_long (argc, argv, "afFhlL:no:rsU:vVwt:",
- longopts, NULL)) != EOF) {
+ longopts, NULL)) != -1) {
switch (c) {
case 'a': /* mount everything in fstab */
++all;
@@ -1448,7 +1451,17 @@ main (int argc, char *argv[]) {
case 133: /* move */
mounttype = MS_MOVE;
break;
-
+ case 134:
+ /* undocumented, may go away again:
+ call: mount --guess-fstype device
+ use only for testing purposes -
+ the guessing is not reliable at all */
+ {
+ char *fstype;
+ fstype = do_guess_fstype(optarg);
+ printf("%s\n", fstype ? fstype : "unknown");
+ exit(fstype ? 0 : EX_FAIL);
+ }
case '?':
default:
usage (stderr, EX_USAGE);