1

I am currently mounting my server using the following command.

mount ip.ip.ip.ip:/home/backups /mnt/backups/

Every time the server reboots I have to add it again manually.

How can I Permanently add it?

Teddy77
  • 2,983

2 Answers2

5

Solution

Add the following entry to your etc/fstab file:

# device       mountpoint     fs-type     options      dump fsckorder
   ...
   ip.ip.ip.ip:/home  /mnt    nfs          rw            0    0
   ...

Reference

The Linux Documentation Project - 4.2. Getting NFS File Systems to Be Mounted at Boot Time

eyoung100
  • 6,252
  • 23
  • 53
-2

Steps to mount a disk permanently.
Doing this will mount your disk during boot time.

  1. Attach your disk manually once.
  2. Goto /proc/mounts and /etc/mtab and look for your mount entry.
  3. Copy the entry that you want to be mounted on boot.
  4. Paste it at the end of /etc/fstab. /etc/fstab Contains entries that are mounted during boot.

You can even manually add your entry in /etc/fstab, but copying it from /proc/mounts or /etc/mtab makes sure that you not make any error or mistake in listing your mount point

more helpful links link 1 link 2

  • Strictly speaking, you don't know that this user is using a system where your solution actually works (I believe it pre-supposes a Linux system). Your answer could benefit from more descriptive links, especially the second of the two. – Kusalananda Jun 28 '22 at 18:06
  • It applies to all linux systems and it is tested and working in ubuntu and centos – Shivam Anand Jun 29 '22 at 05:24
  • Exactly, and the user in the question may possibly be using some other system. Since they don't say that they are using Linux at all, they could just as well be using OpenBSD, Solaris, AIX, macOS or some other Unix. You really ought to check the target of that second link too, as it points to the current question (which may not be useful). – Kusalananda Jun 29 '22 at 06:06