3

When I plug-in my USB Hard Disk which has a NTFS file system, it mounts automatically and works properly.

I am interested to know how this process works. For this, I checked the logs appearing in /var/log/syslog.

In this log, I see the following messages printed:

ubuntu ntfs-3g[3227]: Version 2013.1.13AR.1 external FUSE 29
ubuntu ntfs-3g[3227]: Mounted /dev/sdb1 (Read-Write, label "Hobbies")
ubuntu ntfs-3g[3227]: Cmdline options: rw,nosuid,nodev,uhelper=udisks2,uid=1000,gid=1000,dmask=0077,fmask=0177

I just want to know which process is displaying the above messages?

0

1 Answer 1

0

After fast research I think that it happens about like that: kernel notices a new device, this goes to udev (deals with devices), then to udisksd (disk manager), then via D-Bus the file manager nautilus is informed about a disk, then the filesystem is mounted with FUSE which pulls ntfs-3g userspace filesystem driver (it is in ntfs-3g package) that prints into syslog.

ntfs-3g-2013.1.13AR.1/src/ntfs-3g.c:3660:

    ntfs_log_info("Version %s %s %d\n", VERSION, FUSE_TYPE, fuse_version());
    if (strcmp(opts.arg_device,opts.device))
            ntfs_log_info("Requested device %s canonicalized as %s\n",
                            opts.arg_device,opts.device);
    ntfs_log_info("Mounted %s (%s, label \"%s\", NTFS %d.%d)\n",
                    opts.device, (ctx->ro) ? "Read-Only" : "Read-Write",
                    ctx->vol->vol_name, ctx->vol->major_ver,
                    ctx->vol->minor_ver);
    ntfs_log_info("Cmdline options: %s\n", opts.options ? opts.options : "");
    ntfs_log_info("Mount options: %s\n", parsed_options);
5
  • Thanks for the reply. I also noticed that even if you manually mount the disk using udisk, you get the above log messages.
    – Ronnie
    Apr 20, 2015 at 16:54
  • Well, who else will do the job but the ntfs-3g driver if the filesystem is NTFS?
    – Velkan
    Apr 20, 2015 at 20:10
  • But there is a slight problem here. If nautilus is using ntfs-3g then the parent process of ntfs-3g should be nautilus. But when you run pstree, you see that the parent process of ntfs-3g is init and not nautilus.
    – Ronnie
    May 10, 2015 at 9:45
  • Well, when you run simple mount from shell, the fs doesn't die with the shell. Apparently FUSE has similar behavior for consistency.
    – Velkan
    May 10, 2015 at 11:06
  • Yes. I noticed that if you mount from the terminal, still the parent process is init. When I run the command, ps -ef | grep "mount.ntfs", I get the commandline as -o rw,nosuid,nodev,uhelper=udisks2,uid=1000,gid=1000,dmask=0077, fmask=0177, I want to know who is passing this command line and how to change it
    – Ronnie
    May 10, 2015 at 17:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .