0

The /dev/mapper/vg_db1-lv_root partition used 100%,but the other partition is free,why mongodb store data only use this partition. This is why? How can I solve this problem?

[root@db1 shard11]# df -alh
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/vg_db1-lv_root   50G   48G     0 100% /
proc                           0     0     0    - /proc
sysfs                          0     0     0    - /sys
devpts                         0     0     0    - /dev/pts
tmpfs                       1.9G     0  1.9G   0% /dev/shm
/dev/sda1                   485M   40M  420M   9% /boot
/dev/mapper/vg_db1-lv_home  3.6T  197M  3.4T   1% /home
none                           0     0     0    - /proc/sys/fs/binfmt_misc

The fdisk -h result :

[root@db1 shard11]# fdisk -l

Disk /dev/sda: 1999.0 GB, 1998998994944 bytes
255 heads, 63 sectors/track, 243031 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001c91f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64      243032  1951634432   8e  Linux LVM

Disk /dev/sdb: 1999.0 GB, 1998998994944 bytes
255 heads, 63 sectors/track, 243031 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ebd30

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      243032  1952146432   8e  Linux LVM

Disk /dev/mapper/vg_db1-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_db1-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_db1-lv_home: 3939.6 GB, 3939621666816 bytes
255 heads, 63 sectors/track, 478965 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

And Why the two results are inconsistent?

1
  • What are your startup parameters for mongod? That has a command which specifies your data path. Whatever is in there is where you'll go and if it's empty it's the default path. Commented Apr 11, 2016 at 20:58

1 Answer 1

1

There is no inconsistency here, this is simply due to how you have the volumes mounted and where you have located you MongoDB database path. You have one logical volume mounted on root (/) and the other mounted on /home - I am guessing you do not have your database path in MongoDB set to something under /home instead it is set to something else which is under the root path.

The most common database paths for MongoDB are /data/db (the default) and /var/lib/mongodb (default on Ubuntu for example), but you can set it to whatever you want. Given how you have your mount points configured, both of those common defaults would go under the root mount point and hence onto the /dev/mapper/vg_db1-lv_root volume. If you switch your database path to be under /home or you re-do your mount points appropriately the data will then be placed on the second volume.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.