Changing Linux Mount Points

If you’re familiar with UNIX, you know that changing mount points is really pretty easy. All you have to do is go into “/etc/fstab”, “/etc/vfstab” (or whatever your flavor of UNIX happens to call its filesystem table) and change the mount directory.

If, for instance, you had a Solaris box, and you wanted to make the disk currently mounted as “/data” be mounted as “/database”, all you would have to do is the following:

# umount /data
# mv /data /database
Change this line in “/etc/vfstab” from something like this:
/dev/dsk/c1d0s6 /dev/rdsk/c1d0s6 /data ufs 1 yes -
to something like this:
/dev/dsk/c1d0s6 /dev/rdsk/c1d0s6 /database ufs 1 yes -
and remount it as “/database”.
# mount /database

With Linux, however, it’s not quite so clear anymore… It’s still easy, but it’s just not so clear what you have to do since they have now taken to mounting filesystems using the volume label. Rather than pointing directly to the disk device, Linux points to the label, and “/etc/fstab” look more like this:

LABEL=/data /data ext3 defaults 1 2

You can always simply change the disk label, but if you don’t care, you can just tell linux where the raw device is, bypassing the need to worry about the label. The easiest way to do this is simply to replace the “LABEL=/data” value to the “/dev” entry of the disk itself. Then, simply change “/data” to “/database” and you’re all set.

Here is an example of what you would do to change the mountpoint of “/data” to /database”:

# umount /data
# mv /data /database
Change this line in “/etc/fstab” from this:
LABEL=/data /data ext3 defaults 1 2
to this:
/dev/sda6 /database ext3 defaults 1 2
and remount it as /database
# mount /database

Remembering to change the example values here with those required for your situation.

Discuss This Article


2 Responses to “Changing Linux Mount Points”

  1. spiralbound.net » Working With Disk Labels in RHEL on November 28th, 2006 3:57 pm #

    [...] Labels are, of course, arbitrary, so there is no technical need to do this, and you could, instead simply change the mount point in the fstab file, mounting the partition by device name rather than label, but it is usually cleaner to change the label. Here is how you do it: [...]

  2. user23 on August 23rd, 2007 5:17 pm #

    Is there an easy way to export the same fstab file to multiple machines? I’d like to find a way to easily change the mount points so everyone in our group will have the same.

    Thanks.


Got something to say?






Post Tags (user submitted): t (68) - +linux +"change volume label" (56) - linux change mount point (41) - linux mount label (24) - change volume label linux (24) - linux fstab label (24) - linux mount points (22) - fstab label (17) - change mount point linux (17) - fstab "Label=/1" (16) - change mount point (15) - linux change mount points (14) - linux change disk label (13) - linux change mount (12) - linux mount point (12) - linux vfstab (12) - linux volume label (11) - changing mount points (11) - linux set mount point (10) - change ext3 volume label (10) - label (9) - mount label (9) - solaris mount fstab (9) - linux mount raw (9) - linux mount (8) - "LABEL=/1" fstab (8) - linux mountpoints (8) - ext3 "change volume label" (8) - change volume label ext3 (8) - volume label linux (8) - linux set volume label (8) - linux mount by label (8) - all (7) - linux fstab (7) - "fstab howto" (7) - linux mount disk fstab (7) - linux fstab bind (7) - linux change disk volume label (7) - fstab (6) - LABEL fstab (6) - fstab labels (6) - Linux mount bind fstab (6) - Linux change partition label (6) - vfstab linux (6) - changing mount points linux (5) - how to change mount point Linux (5) - linux changing volume label (5) - changing mount point (5) - set volume label linux (5) - mount fstab label= (5) - fstab LABEL mount (5) - rhel fstab label (5) - change label disk linux (5) - setting mount points linux (5) - change mount points linux (5) - change mount points in linux (5) - changing mountpoints (5) - linux show volume label (5) - solaris (4) - old Ironforge (4) - change "volume label" (4) - change mount points (4) - linux disk label (4) - change volume label in linux (4) - changing linux mount points (4) - mss (4) - linux changing volume labels (4) - CHANGING MOUNT POINTS IN LINUX (4) - linux disk volume label (4) - change mount point name (4) - change-disk-label linux (4) - change linux mount point (4) - linux change mount point name (4) - linux change partition label mount point (4) - mount LABEL linux (4) - linux mountpoint (4) - linux change mountpoints (4) - Change disk volume label Linux (4) - change Mount Point name linux (4) - changing "volume label" linux (3) - changing ext3 volume label (3) - wierd images (3) - changing label in fstab (3) - old ironforge howto (3) - change volume.label Linux (3) - linux "changing label" (3) - changing label fstab (3) - linux changing mount point (3) - linux LABEL=/1 (3) - linux disk label fstab (3) - linux mount vfstab (3) - linux fstab howto (3) - linux disk labels fstab (3) - changing fstab linux (3) - setting mount point linux (3) - linux change LABEL fstab (3) - "mount --bind" linux fstab (3) - linux change fstab (3) - change mount point in linux (3) - change linux mount points (3) - linux mount disk (3) - linux mount by name (3) - change linux volume label (3) - fstab change (3) - mount linux fstab (3) - mount raw device linux (3) - fstab mount by label (3) - linux change label name (3) - solaris mount ext3 (3) - fstab mount ext3 (3) - solaris mount bind (3) - change mountpoint linux (3) - change mount point rhel (3) - ext3 volume label (3) - linux change directory mount point (3) - fstab change LABEL (3) - mount raw (3) - linux how to change mount name (3) - linux change mountpoint (3) - linux changing mount points (3) - linux rename volume label (3) - linux change volume name (3) - change a mount point in linux (3) - COOL ARMOR (2) - changing linux label (2) - linux change LABEL=/1 (2) - unix mount points (2) - changing linux fstab (2) - "change volume label" linux ext3 (2) - linux changing disk label (2) - linux mount --bind (2) - "volume label" linux -swap (2) - "how to change disk" linux (2) - fstab "volume label" (2) - mount a volume in linux (2) - Mountpoints in linux (2) - linux change LABEL=/ (2) - solaris metadb -a (2) - changing mountpoints in linux (2) - change fstab LABEL (2) - how to change volume label linux (2) - changing volume label on ext3 (2) - change mount point partition linux (2) - linux volume label mount (2) - linux change label disk (2) - how to change mount point (2) - linux volume mount point (2) - label fstab change (2) - change LABEL in fstab (2) - "change volume name" fstab (2) -