Solved

Moutinng Raid

Posted on 2014-03-20
8
238 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
Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

 
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Concerto Cloud Services, a provider of fully managed private, public and hybrid cloud solutions, announced today it was named to the 20 Coolest Cloud Infrastructure Vendors Of The 2017 Cloud  (http://www.concertocloud.com/about/in-the-news/2017/02/0…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

730 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