Thursday, March 12, 2009

How To FreeBSD Remount mount read only Partition

How To FreeBSD Remount mount read only Partition

Q. How do I remount partition under FreeBSD? How do I mount readonly partition as (remount) read write mode?

A. Linux or other Unixish oses need to pass -o remount option to mount command. However, FreeBSD does not require any special option to remount file system. It can use 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 following command (log in as a root user):

Freebsd Remount Command
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:
rw : Read write
ro : Read only
Make sure you replace /dev/ad0s1a and / with appropriate values.

File System Table Mount
# cat /etc/fstab
# Device Mountpoint FStype Options Dump Pass#
/dev/ar0s1b none swap sw 0 0
/dev/ar0s1a / ufs rw 1 1
/dev/ar0s1d /usr ufs rw 2 2
/dev/ar0s1e /var ufs rw 2 2
/dev/acd0 /cdrom cd9660 ro,noauto 0 0

No comments: