LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to auto mount a file system on reboot (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-auto-mount-a-file-system-on-reboot-911779/)

gvsbnarayana 11-03-2011 11:26 PM

how to auto mount a file system on reboot
 
Hi,
I am a newbie using Oracle Enterprise Linux (flavor of Red Hat Linux). I have added a new disk and created a mount point /u02. How can I get it auto mount on reboot of the server?


# uname -a
Linux rac11g 2.6.18-92.1.17.0.2.el5xen #1 SMP Tue Nov 18 04:11:19 EST 2008 i686 i686 i386 GNU/Linux
#cat /etc/redhat-release
Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)

right now, after mounting the file system manually,

# mount -l
/dev/xvdb on /u02 type ext3 (rw)

I have mounted the file system manually using:
mount /dev/xvdb /u02

I appreciate your help.

Thanks and Regards,
Badri.

mladoux 11-03-2011 11:38 PM

add the following to the end of your /etc/fstab --

Code:

/dev/xvdb        /u02        ext3        defaults        0        2
make sure it's all one line, and by itself.

smilesavvy 11-03-2011 11:42 PM

The above Solution works for you.

devUnix 11-04-2011 01:22 AM

Badri, just have a look at

Code:

/etc/fstab
file and follow the format. Beware that if you mess up with this file then your system may not boot next time. However, you will get warnings/errors as soon as you save your edits and quit from this file, in case you make a mistake.

deep27ak 11-04-2011 01:33 AM

Quote:

Originally Posted by gvsbnarayana (Post 4515418)
Hi,
I am a newbie using Oracle Enterprise Linux (flavor of Red Hat Linux). I have added a new disk and created a mount point /u02. How can I get it auto mount on reboot of the server?


# uname -a
Linux rac11g 2.6.18-92.1.17.0.2.el5xen #1 SMP Tue Nov 18 04:11:19 EST 2008 i686 i686 i386 GNU/Linux
#cat /etc/redhat-release
Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)

right now, after mounting the file system manually,

# mount -l
/dev/xvdb on /u02 type ext3 (rw)

I have mounted the file system manually using:
mount /dev/xvdb /u02

I appreciate your help.

Thanks and Regards,
Badri.

Code:

#vi /etc/fstab
/dev/xvdb    /u02    ext3    defaults  0 0

#mount -a
to check if everything is working fine as it updates fstab file

#mount
check your mount point


gvsbnarayana 11-05-2011 08:21 AM

Thanks a lot for your help. I will try and update you.
I appreciate your help.
Regards,
Badri

Passmossis 11-05-2011 08:37 AM

If this does not work for you, you can create a mount script and place it within /etc/rc5.d. Things here take place in a specific order, so make sure you give it a name that is towards the end of the list.

Quote:

S995SANMount.scr
is an example name that should be towards the end of the operations. Note this mount would only take place when the system goes for init level 5 (standard boot)


All times are GMT -5. The time now is 11:39 PM.