How To FreeBSD Remount Partition

How do I remount partition on FreeBSD operating systes? How do I mount/remount read-only partition in read-write mode without rebooting the systems?

Tutorial details
Difficulty Easy (rss)
Root privileges Yes
Requirements FreeBSD
Time 2m
Linux or other Unixish operating systems need to pass the -o remount option to the mount(8) command to remount partition. However, FreeBSD does not require any special option to remount file system. It can use your standard mount command. The mount utility calls the mount(2) system call to prepare and graft a special device or the remote node (rhost:path aka NFS) on to the file system tree at the point node. For example, if your file system is mounted in read only mode then you can remount it using the following command. First, login as root user.

ADVERTISEMENTS

Freebsd remount disk command example

Type the following command as the root user (superuser):
# mount -o rw /dev/ad0s1a /
OR
# mount -o rw /
Where,

  • -o : Takes different options as follows:
    1. rw : Read write mount.
    2. ro : Read only mount.

Make sure you replace /dev/ad0s1a and / with appropriate values. See FreeBSD mount command man page for more information.

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
3 comments… add one
  • Steve Kamerman Jul 18, 2008 @ 11:31

    Your first example did not work for me on FreeBSD 6.1, but if I leave the device off (like in your second command), it does work properly as shown here:


    frenzy:~# mount -o rw /dev/ad0s1a /mnt/ad0s1a.ufs/
    mount: /dev/ad0s1a: Operation not permitted
    frenzy:~# mount -o rw /mnt/ad0s1a.ufs/
    frenzy:~#

    Thanks for the tip (I’m a Linux geek, so these subtle differences are annoying)!

  • Tom Bailey Sep 8, 2009 @ 0:38

    If you update an entry in fstab you can test it like this
    mount -o remount /fstabmountpoint

    This will remount ALL mount points mentioned in fstab that are automounted
    mount -o remount -a
    ———————————————————————-
    From http://www.manpager.com/linux/man8/mount.8.html
    mount -a [-t type] [-O optlist]

    (usually given in a bootscript) causes all file systems mentioned in fstab (of the proper type and/or having or not having the proper options) to be mounted as indicated, except for those whose line contains the noauto keyword. Adding the -F option will make mount fork, so that the filesystems are mounted simultaneously.

    (ii) When mounting a file system mentioned in fstab, it suffices to give only the device, or only the mount point.

  • Nux Jan 8, 2011 @ 17:21

    That thing doesn’t work. In my case I needed to remount as noexec.
    What works (on my freebsd 6) is:
    mount -u -o noexec /tmp

    Check the manpage for mount.

    Mount -o remount,opts only works on Linux afaik.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.