?
Solved

Moutinng Raid

Posted on 2014-03-20
8
Medium Priority
?
240 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
Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

 
LVL 48

Accepted Solution

by:
Tintin earned 1500 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 79

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
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…
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.
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

800 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