LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-05-2013, 04:46 AM   #1
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 193
Blog Entries: 1

Rep: Reputation: 21
Multiple mounts under same parent directory


Hi Gurus

I have RHEL 5.4 server installed on a HP Proliant Server. Our security team asked me to go for a dedicated filesystems for the following directories.
/var
/var/log
/var/log/audit

I just created three logical volumes and mounted on respective directories as we do for usually. Once the server is rebooted, it couldnt log anything in /var/log.
As a workaround, i have unmounted all the above mount points and rebooted server which solved my issue. Now, Could someone tell me, is there any way to mount different logical volumes under a directory and its subdirectories.
 
Old 03-05-2013, 04:56 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
The order of mounting is important in this case.

You first need to mount /dev/abc to /var, then mount /dev/def to /var/log and then /dev/ghi to /var/log/audit.

Make sure the order is correct in your /etc/fstab file.
 
Old 03-05-2013, 05:29 AM   #3
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 193
Blog Entries: 1

Original Poster
Rep: Reputation: 21
Hi Drunna

Thanks for your reply. I mentioned in the way you mentioned only.
Problem resolved after i use the option bind in the /etc/fstab file.

/dev/LV1/LogVol03 /var ext3 defaults 1 2
/dev/LV1/LogVol07 /var/log none bind 0 0
/dev/LV1/LogVol08 /var/log/audit none bind 0 0

It has been tested that the logs has been registered without any issues in /var/log filesystem. Let me know if anyone else any other idea/suggestion.
 
Old 03-05-2013, 05:36 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by kingston View Post
Hi Drunna

Thanks for your reply. I mentioned in the way you mentioned only.
Problem resolved after i use the option bind in the /etc/fstab file.

/dev/LV1/LogVol03 /var ext3 defaults 1 2
/dev/LV1/LogVol07 /var/log none bind 0 0
/dev/LV1/LogVol08 /var/log/audit none bind 0 0

It has been tested that the logs has been registered without any issues in /var/log filesystem. Let me know if anyone else any other idea/suggestion.
The above might work, but looks incorrect to me.

You mention creating LV's, did you format all three (first seems to be ext3, are the other 2 ext3 too)?

The following should work when the LV's are created and formatted (as ext3) correctly:
Code:
/dev/LV1/LogVol03     /var            ext3      defaults    0   2
/dev/LV1/LogVol07     /var/log        ext3      defaults    0   2
/dev/LV1/LogVol08     /var/log/audit  ext3      defaults    0   2
BTW: What's the output of mount (after all the partitions are mounted)?
 
Old 03-05-2013, 06:16 AM   #5
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 193
Blog Entries: 1

Original Poster
Rep: Reputation: 21
Hi,

You are Correct. I couldnt see the mount entries for /var/log and /var/log/audit. I am going to apply your suggestion soon and would come up with the output.

Quote:
[root@test~]# mount
/dev/mapper/LV1-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/mapper/LV1-LogVol04 on /opt type ext3 (rw)
/dev/mapper/LV1-LogVol05 on /tmp type ext3 (rw,nosuid,nodev)
/dev/mapper/LV1-LogVol02 on /usr type ext3 (rw)
/dev/mapper/LV1-LogVol01 on /home type ext3 (rw,nodev)
/dev/mapper/LV1-LogVol03 on /var type ext3 (rw)
/dev/cciss/c0d0p1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)
/tmp on /var/tmp type none (rw,bind)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
Quote:
[root@test~]# cat /etc/fstab
/dev/LV1/LogVol00 / ext3 defaults 1 1
/dev/LV1/LogVol04 /opt ext3 defaults 1 2
/dev/LV1/LogVol05 /tmp ext3 defaults,nodev,nosuid 1 2
/dev/LV1/LogVol02 /usr ext3 defaults 1 2
/dev/LV1/LogVol01 /home ext3 defaults,nodev 1 2
/dev/LV1/LogVol03 /var ext3 defaults 1 2
#/dev/LV1/LogVol07 /var/log ext3 defaults 1 2
#/dev/LV1/LogVol08 /var/log/audit ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs rw,noexec,nosuid,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/LV1/LogVol06 swap swap defaults 0 0
/tmp /var/tmp none bind 0 0
/dev/LV1/LogVol07 /var/log none bind 0 0
/dev/LV1/LogVol08 /var/log/audit none bind 0 0
 
Old 03-05-2013, 09:25 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,239

Rep: Reputation: 577Reputation: 577Reputation: 577Reputation: 577Reputation: 577Reputation: 577
Check ownership, permission, and security label of the given directory used for the mount point both before and after the mount.

One of the problems that can happen is that directories with some of those mounts (such as /var/log) have multiple subdirectories (such as audit) and they need to have proper ownership (user/group), access modes, and security labels or the system will be unable to start properly.

You might get the security label correct using a restorecon after all mounts (done manually at single user mode though).
 
Old 03-06-2013, 06:21 AM   #7
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 193
Blog Entries: 1

Original Poster
Rep: Reputation: 21
@jpollard

Hi ! Thanks for your reply. As you suggested, restorecon command has been used to set back directory selinux contexts. Now it is working fine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
export multiple executable paths in a parent directory using regular expressions? lmcilwain Linux - General 2 10-03-2012 09:01 AM
Create a directory named like his Parent Directory sina_saeedi82 Linux - Newbie 8 05-26-2011 11:36 AM
C - Using pipes with a parent that has multiple children golmschenk Programming 5 03-07-2010 03:30 PM
List only the parent directory scottrell Linux - General 6 11-07-2003 09:10 AM
mv the contents of one directory to the parent directory warkrime Linux - Newbie 4 07-14-2003 07:03 PM


All times are GMT -5. The time now is 03:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration