LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-02-2020, 10:42 AM   #1
Sambrad
LQ Newbie
 
Registered: Jul 2020
Posts: 3

Rep: Reputation: Disabled
Centos 7.6 partitioning directory problem


I need help with mounting a partition and making a directory on it
Running lsblk reveals
sda 8:0 0 558.4G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 557.4G 0 part
├─centos-root 253:0 0 50G 0 lvm /
├─centos-swap 253:1 0 15.7G 0 lvm [SWAP]
└─centos-home 253:2 0 491.7G 0 lvm /home
sdb 8:16 0 1.7T 0 disk
└─sdb1 8:17 0 200G 0 part /mnt
sr0 11:0 1 1024M 0 rom
I need to get sdb1 setup with a directory called database for use with ordering software and to get it viewable (does not show up using ls-a etc)
Please help as this is a real stumbling block for me
Thanks in advance for advice /help
 
Old 07-02-2020, 12:01 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
it looks like sdb1 is mounted on /mnt. I do not really understand what do you want to achieve.
 
Old 07-02-2020, 12:39 PM   #3
Sambrad
LQ Newbie
 
Registered: Jul 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Sambrad View Post
I need help with mounting a partition and making a directory on it
Running lsblk reveals
sda 8:0 0 558.4G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 557.4G 0 part
├─centos-root 253:0 0 50G 0 lvm /
├─centos-swap 253:1 0 15.7G 0 lvm [SWAP]
└─centos-home 253:2 0 491.7G 0 lvm /home
sdb 8:16 0 1.7T 0 disk
└─sdb1 8:17 0 200G 0 part /mnt
sr0 11:0 1 1024M 0 rom
I need to get sdb1 setup with a directory called database for use with ordering software and to get it viewable (does not show up using ls-a etc)
Please help as this is a real stumbling block for me
Thanks in advance for advice /help
The Question of what I am trying to achieve is to have a repository for the database in a directory called database permanently mounted and findable by the main software on the first Raid 1 drive where the Centos operating system resides. The database is on the Raid 5 other 4 disks and just needs to be accessible at the moment it does not show up using any directory search ls -a etc
 
Old 07-02-2020, 12:41 PM   #4
Sambrad
LQ Newbie
 
Registered: Jul 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Sambrad View Post
The Question of what I am trying to achieve is to have a repository for the database in a directory called database permanently mounted and findable by the main software on the first Raid 1 drive where the Centos operating system resides. The database is on the Raid 5 other 4 disks and just needs to be accessible at the moment it does not show up using any directory search ls -a etc
It is no good having a Server with the data on the Main OS drives so we install the software on the first Raid and have a database on the second Raid which is on a 200GB partition (already done xfs) easily accessible and viewable The database is Postgres by the way
 
Old 07-02-2020, 12:52 PM   #5
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Then you should select a mountpoint for your database, say /var/database and make an entry for it in /etc/fstab. Something like
Code:
/dev/sdb1 /var/database xfs defaults 0 2

Last edited by shruggy; 07-02-2020 at 12:57 PM.
 
Old 07-02-2020, 01:02 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
You can mount sdb1 anywhere on the "tree". The default CentOS 7.x data directory for postgresql is /var/lib/pgsql and IMHO would keep it the same location i.e just mount sdb1 at /var/lib/pgsql.

I assume that postgresql is currently installed.

Shutdown postgresql
rsync the existing data to /mnt (since it is already mounted there)
Remount sdb1 /var/lib/pgsql
Restart postgresql

The old data still exists on the / but you can go back and delete it by shutting down the server and unmounting sdb1.

It depends on what you mean by accessible and viewable. Any application would use an existing API to access the database i.e libreoffice, php, c program etc or even pg_dump. The only reason I ever directly access the /var/lib/pgsql/.. would be to change a configuration file.

Last edited by michaelk; 07-02-2020 at 01:34 PM.
 
  


Reply



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
CentOS - Enable directory browsing on a linked directory. systemlordanubis Linux - Server 2 11-05-2015 11:41 PM
[SOLVED] NFS on CentOS 6 can talk to Centos 5 but not Centos 6 clients deathsfriend99 Linux - Server 2 11-08-2013 02:33 PM
CentOS Directory server - Can Windows machine be added into directory server manya Linux - Server 3 01-19-2012 03:48 PM
LXer: CentOS Directory Server On CentOS 5.2 LXer Syndicated Linux News 0 08-06-2008 09:20 PM
UK Finance Directory,Online Finance Directory,UK Finance,Finance Directory in UK seekuk General 1 12-30-2005 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration