Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

If I run df -h in an Oracle LINUX 5 server, I got below output:

 $ df -h
        Filesystem            Size  Used Avail Use% Mounted on
        /dev/sda2              12G  8.8G  1.8G  84% /
        /dev/sda4             3.8G  592M  3.0G  17% /home
        /dev/sda1              99M   70M   24M  75% /boot
        tmpfs                 942M     0  942M   0% /dev/shm
        /dev/sdc1              51G  1.8G   46G   4% /u000

I installed MySQL 5.1.73-community-log in this server which is running. If I run below command:

mysql> show variables like '%dir%';

+-----------------------------------------+----------------------------+
| Variable_name                           | Value                      |
+-----------------------------------------+----------------------------+
| basedir                                 | /                          |
| binlog_direct_non_transactional_updates | OFF                        |
| character_sets_dir                      | /usr/share/mysql/charsets/ |
| datadir                                 | /var/lib/mysql/            |
| innodb_data_home_dir                    |                            |
| innodb_log_group_home_dir               | ./                         |
| innodb_max_dirty_pages_pct              | 90                         |
| plugin_dir                              | /usr/lib64/mysql/plugin    |
| slave_load_tmpdir                       | /tmp                       |
| tmpdir                                  | /tmp                       |
+-----------------------------------------+----------------------------+
10 rows in set (0.00 sec)

Please advice about:

  • how can I Know in which partition, MySQL has been installed?
  • Which Partition will be used by MysQL to store data?
  • What is /dev/sdc1 and how can I use the enough space available (46G)?
  • What is tmpfs?
share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted
  • What is tmpfs?

Tmpfs is a file system which keeps all files in virtual memory. Read More


  • What is /dev/sdc1 and how can I use the enough space available (46G)

/dev/sdc1 is just another file system that you have created and mounted in your system. The mount point is /u000. Read more on mount points


  • how can I Know in which partition, MySQL has been installed?

  • Which Partition will be used by MysQL to store data?

Check answer here

Quoting from answer in the link above:

mysql -uUSER -p -e 'SHOW VARIABLES WHERE Variable_Name LIKE "%dir"'

basedir gives the installation directory.

datadir gives the directory where the data is stored.

Refer here for a detailed explanation of each dir

--basedir=path

The path to the MySQL installation directory.

--datadir=path

The path to the MySQL data directory.

To check which filesystem (mount point) a directory belongs to:

For eg, if I want to find out which file system the /home directory belongs to, df /home

output:

/home                (/dev/sda4     ):  5895840 blocks     92467 i-nodes

where /dev/sda4 is the file system where the /home resides

Refer here to change the mount point of MySQL.

share|improve this answer
    
I have already installed MySQL. As per the df command - my installation is in /dev/sda2. But, available space is less than 2GB. Now, is there any way through I can move my datadir to /dev/sdc1? –  ursitesion Apr 25 at 6:49
    
Is there any command to know the total Disk space in my server? –  ursitesion Apr 25 at 7:37
    
Yes, I ran df - H command and as per the result, it is 71GB only. So, how much the real Hard disk my server has? –  ursitesion Apr 25 at 7:52
    
@ursitesion fdisk -l | grep Disk shows the total space of each hard disk in the system –  debal Apr 25 at 7:54
    
Disk /dev/sda: 21.4 GB, 21474836480 bytes Disk /dev/sdb: 21.4 GB, 21474836480 bytes Disk /dev/sdc: 54.7 GB, 54760833024 bytes –  ursitesion Apr 25 at 7:59
show 2 more comments
  1. Since your plugin_dir is on / ( /usr/lib64/... your installation is almost sure on /dev/sda2
  2. Also /dev/sda2 as that is where the data directory (/var/...) is located.
  3. /dev/sdc1 is a partition on a different drive, you could configure MySQL with a datadir of /u000/mysql after creating that directory
  4. tmpfs is a temporary filesystem, i.e. one that doesn't survive a reboot. It has nothing to do with the MySQL setup.
share|improve this answer
    
For #3, can I do this now? –  ursitesion Apr 25 at 6:37
    
@ursitesion If you don't have any data in your databases, you should be able to change things. Always stop the server while doing these kind of changes. If you do have data, or want to be safe, then you should stop your MySQL server, copy all the files from /var/lib/mysql to /u000/mysql and restart the service. –  Anthon Apr 25 at 7:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.