LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help with mounting devices on Centos (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-mounting-devices-on-centos-4175504718/)

NotionCommotion 05-12-2014 08:34 AM

Help with mounting devices on Centos
 
My /etc/fstab file and the output of mount is listed below.

Note that /var/lib/mysql was manually mounted (after stopping mysql) using:
Code:

mount -t ext3 -o barrier=0 /dev/VolGroup/lv_mysql /var/lib/mysql
My main question is how do I modify /etc/fstab to automatically mount /var/lib/mysql just like the output of mount shows? Note that when I uncomment the line in my fstab, my Linux crashes upon trying to boot.

Secondary questions are:
  1. Why is none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) shown when I execute mount, but not in my /etc/fstab file?
  2. Why is /dev/mapper/VolGroup-lv_swap swap swap defaults 0 0 shown in my /etc/fstab file, but not when I execute mount?
  3. Why does /etc/fstab show /dev/sda1 as UUID=12a081eb-285e-4599-95ab-db23b70280df? This is the same device, right?

Thank you

Code:

[root@devserver ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sat Apr 19 05:57:56 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-lv_root /                      ext4    defaults        1 1
UUID=12a081eb-285e-4599-95ab-db23b70280df /boot                  ext4    defaults        1 2
/dev/mapper/VolGroup-lv_home  /home                  ext4    defaults        1 2
#/dev/mapper/VolGroup-lv_mysql /var/lib/mysql        ext3    barrier=0;noauto      1 2
/dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0
tmpfs                  /dev/shm                tmpfs  defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                  /sys                    sysfs  defaults        0 0
proc                    /proc                  proc    defaults        0 0
[root@devserver ~]#

Code:

[root@devserver ~]# mount
/dev/mapper/VolGroup-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/VolGroup-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/mapper/VolGroup-lv_mysql on /var/lib/mysql type ext3 (rw,barrier=0)
[root@devserver ~]#


ericson007 05-12-2014 08:52 AM

Try to put a comma after the no barrier option in your fstab file, i am not sure that semicolons are useable, they are generally for comments, so you likely comented out your options field.

1. It is a kernel capability for passing files around. It is mounted by an init script that is why it is there and not in fstab

2.shot in the dark,but it is not a normal file system and not useable as such for storage. You would see it allocated using top or the free command, probably due to being mapped to memory registers. Interesting question this one.

3. Newer systems mount the uuid, same as dev, same device but if you go switching cables, sda1 may become sdc1 the uuid stays the same so it does not matter which sata port the disk is connected to, it willmount the file system in the correct location.

michaelk 05-12-2014 10:28 AM

In addition the option noauto will prevent the file system from automatically being mounted at boot.

In a nutshell /proc is a virtual file system i.e. it resides in memory. It is a method to access internal kernel data structures. As stated it is created at boot time. tmpfs and sysfs are also virtual file systems.

NotionCommotion 05-12-2014 12:29 PM

Thank you ericson007 and michaelk,

Your responses make sense. Also, I also later realized that the noauto would prevent it from mounting at boot. I don't know for sure, but expect a semicolon or a comma would both work, but I know for sure a comma does.

In regards to modifying /etc/fstab to mount /var/lib/mysql, it now works perfectly. I am 99% sure I did the exact thing earlier, but with very bad results. Reference http://www.linuxquestions.org/questi...on-4175502842/. What is different, I have no idea, but the issue is fixed.

Thanks again, Michael


All times are GMT -5. The time now is 10:56 AM.