Solved

Moutinng Raid

Posted on 2014-03-20
8
232 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
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
 
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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 

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 76

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Having issues meeting security compliance criteria because of those pesky USB drives? Then I can help you! This article will explain how to disable USB Mass Storage devices in Windows Server 2008 R2.
AWS Glacier is Amazons cheapest storage option and is their answer to a ‘Cold’ storage service.  Customers primarily use this service for archival purposes and storage of infrastructure backups.  Its unlimited storage potential and low storage cost …
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now