Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1620
  • Last Modified:

Reboot CentOS, re-mount external drives

I have the following two mount commands that work fine. However, I don't know how to implement these commands so it always mounts on reboot.  The operating system is CentOS.

mount -t nfs nas:/eng /mnt/httpdocs
mount -t nfs nas:/backup /mnt/backup

Right now I have to run the mount commands after a reboot.

Thanks.
0
expertis
Asked:
expertis
  • 4
  • 2
  • 2
2 Solutions
 
LuxanaCommented:
0
 
Kerem ERSOYPresidentCommented:
Hi,
As Luzana pointed out the document you may use the output redirection.

Or you might edit your /etc/fstab and in the file add these lines:
nas:/eng   /mnt/httpdocs  nfs defaults 0 0
nas:/backup  /mnt/backup  nfs defaults 0 0

It is important to keep the last 2 columns be always 0 when mounting volumes from remote systems.
0
 
expertisAuthor Commented:
Thanks for the link to the instructions, but I need to make sure I have this absolutely correct before continuing.  So, the instructions say run the following from the command line;
echo "10.1.1.200:/home/nfs /home/nfs_local/ nfs defaults 0 0" >> /etc/fstab

Does this mean I change my commands to;
echo "nas:/eng /mnt/httpdocs nfs" >> /etc/fstab
echo "nas:/backup /mnt/backup nfs" >> /etc/fstab

But what about the '-t' switch? I'm using the '-t' based on instructions from the NAS manufacturer.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
expertisAuthor Commented:
It looks like KeremE answered the previous question. Thanks.
0
 
LuxanaCommented:
> But what about the '-t' switch? I'm using the '-t' based on instructions from the NAS manufacturer.

/etc/fstab has its own format. In fstab you specified type in 3th column which is nfs .
0
 
Kerem ERSOYPresidentCommented:
yr welcome :)
0
 
Kerem ERSOYPresidentCommented:
BTW -t (type) is a switch for the mount command but instead you have a special  column to specify the Filesystem type in fstab. So you can savely ignore -t here.
0
 
Kerem ERSOYPresidentCommented:
Opps Luxana already answered this. I only saw after posting sorry for duplicate info.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now