Solved

Moutinng Raid

Posted on 2014-03-20
8
239 Views
Last Modified: 2014-04-14
Hi,

 I'm not an expert in linux, I'm trying to build some servers with raid 1.

 I had created a directory on / as /srv/mysql.

I had created a raid partition /dev/md0 & I had mounted it on /srv/mysql.

Now my question is does the data gets stored in both the locations or /srv/mysql is just a shortcut referring to Raid Partition.
0
Comment
Question by:pcisiva
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 39944476
/srv/mysql is the mount point for your file system, so any file/dirs under that mount point exist on your RAID 1 drives.
0
 

Author Comment

by:pcisiva
ID: 39944480
tintin Files Exists in Both the places? Right ie; diskspace
0
 

Author Comment

by:pcisiva
ID: 39944486
I want to confirm

if the data gets stored in the /dev/md0 drive  ie; is /srv/mysql is just a shortcut? to the raid parition

or

The data gets stored in /srv/mysql
0
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 39944491
Think of the mount point as a shortcut.

If you can mount a filesystem on whatever directory you like.   Once you unmount it, there are no files/dirs left behind.
0
 

Author Comment

by:pcisiva
ID: 39944493
What happens if there is already a directory & i had mounted a raid partition on that directory.

Will the files present here in directory get moved to the raid partition?

Or only new files placed in the raid partition?
0
 
LVL 48

Expert Comment

by:Tintin
ID: 39944507
If you mount a filesystem on top of a directory that already contains files, it effectively makes them hidden.   They will appear again when you unmount the filesystem.

Think of it a little like placing a book on top of another book.  Only the  words ("files") of the book on top is active and the two books remain separated.
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39944639
md0 is block device and you can't mount block device directly and block device has to be accessed from mount point only.. And yes once you store data in mount point it will be stored within the block device..

Like in windows drive letters  are being used as a block device mappers, in linux we use mount-points (dir)

TY/SA
0
 
LVL 78

Expert Comment

by:arnold
ID: 39945829
presumably /srv/mysql as the name implies is for use with mysql data files.

People covered your question, just adding the following as you may run into issues:

permissions are stored on the device not the mount point/short cut.
i.e.
Before loading/mounting/overlaying md0 onto /srv/mysql
/      root other drwxr-xr-x
/srv root other drwxr-xr-x
/srv/mysql  mysql mysql drwxrwxr-x

now you have your RAID 1 md0 and you load/mount/overlay /dev/md0 onto the /srv/mysql now your permissions will look like this
/      root other drwxr-xr-x
/srv root other drwxr-xr-x
/srv/mysql  root other drwxr-xr-x

The reason is that the permissions are stored on /dev/md0 and not as part of the mount point/shortcut.
You have to remember that when you are adding storage resource, you must set the permissions:
chown - Change ownership in this case to mysql user with mysql group chown mysql:mysql
chmod - change file access permissions (NOTE: ownership changes need to be made first when needed.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Each year, investment in cloud platforms grows more than 20% (https://www.immun.io/hubfs/Immunio_2016/Content/Marketing/Cloud-Security-Report-2016.pdf?submissionGuid=a8d80a00-6fee-4b85-81db-a4e28f681762) as an increasing number of companies begin to…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question