what the difference between remount to umount/mount?

18,394

Solution 1

man mount :

remount

Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writeable. It does not change device or mount point. The remount functionality follows the standard way how the mount command works with options from fstab. It means the mount command doesn't read fstab (or mtab) only when a device and dir are fully specified.

The remount option is used when the file system isn't currently in use to modify the mount option from ro to rw.

target is busy.

If the file system is already in use you can't umount it properly , you need to find the process which accessed your files (fuser -mu /path/ ) , killing the running process then unmounting the file.

Solution 2

GAD3R's reference to the man page answers your question:

This is commonly used to change the mount flags for a filesystem,

No where in the that explanation does it say the remount calls a umount function.

Perhaps you can find your answers in these manpages

man 2 mount:

  • A call to mount() performs one of a number of general types of operation, depending on the bits specified in mountflags. The choice of which operation to perform is determined by testing the bits set in mountflags, with the tests being conducted in the order listed here:

  • Remount an existing mount: mountflags includes MS_REMOUNT.

  • Remounting an existing mount An existing mount may be remounted by specifying MS_REMOUNT in mountflags. This allows you to change the mountflags and data of an existing mount without having to unmount and remount the filesystem. target should be the same value specified in the initial mount() call.

Share:
18,394

Related videos on Youtube

yael
Author by

yael

Updated on September 18, 2022

Comments

  • yael
    yael over 1 year

    When we perform this (on linux redhat 7.x)

    umount /grop/sdc
    umount: /grop/sdc: target is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
    

    We can see that mount failed on busy.

    But when we do remount then ... remount is success as the following:

    mount -o rw,remount /grop/sdc
    echo $?
    0
    

    So very interesting.

    Does remount use the option like ( umount -l ) ? what the different between remount to umount/mount ?

  • yael
    yael over 6 years
    so the remount dose like - umount -l & mount ?
  • Pierre.Vriens
    Pierre.Vriens over 6 years
    Please include a relevant quote from those man pages ...