LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error: rpmdb open failed (https://www.linuxquestions.org/questions/linux-newbie-8/error-rpmdb-open-failed-4175469229/)

windstory 07-10-2013 11:40 PM

Error: rpmdb open failed
 
My box is SCience Linux 6.3 x64, and I got this error message.

Quote:

[root@maestro Documents]# yum -y update
error: db3 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index using db3 - Invalid argument (22)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

Please let me know how to resolve this.

Thanks in advance.

Linux MR 07-10-2013 11:51 PM

The common fix is to delete the rpm databases and run rebuilddb, like

Quote:

# yum clean all
# rm -f /var/lib/rpm/__db*
# rpm --rebuilddb
# yum update
Hope that helps

eklavya 07-11-2013 12:26 AM

The problem is a corrupted rpm database, mostly coming into existence because of an aborted update process. It also happens sometimes when the package containing rpm itself is updated.

The solution is to delete and then rebuild the database:

Code:

# rm -f /var/lib/rpm/__db.[0-9][0-9]*
# rpm --quiet -qa

I hope this helps.

windstory 07-11-2013 03:59 AM

Quote:

Originally Posted by Linux MR (Post 4988180)
The common fix is to delete the rpm databases and run rebuilddb, like
Hope that helps

The result is here.

Quote:

[root@maestro Documents]# yum clean all
error: db3 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index using db3 - Invalid argument (22)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed
[root@maestro Documents]# rm -f /var/lib/rpm/__db*
[root@maestro Documents]# rpm --rebuilddb
error: failed to create directory /var/lib/rpmrebuilddb.2843: No space left on device
[root@maestro Documents]# yum update
rpmdb: write: 0x1394b30, 8192: No space left on device
Bus error

eklavya/

The result is here.

Quote:

[root@maestro Documents]# rpm --quiet -qa
rpmdb: write: 0x1f9cac0, 8192: No space left on device
Bus error

Madhu Desai 07-11-2013 05:27 AM

Did you check for the availability of free disk space on the filesystem where /var is hosted. While installing/updating, yum caches downloaded files to /var/cache/yum directory. If enough space is not available in /var filesystem, then yum will fail.

windstory 07-11-2013 06:48 AM

Quote:

Originally Posted by mddesai (Post 4988310)
Did you check for the availability of free disk space on the filesystem where /var is hosted. While installing/updating, yum caches downloaded files to /var/cache/yum directory. If enough space is not available in /var filesystem, then yum will fail.

How to check for the availability of free disk space on the filesystem?

Madhu Desai 07-11-2013 06:52 AM

Code:

df -h

windstory 07-11-2013 06:59 AM

Quote:

Originally Posted by mddesai (Post 4988355)
Code:

df -h

The result is this.

Quote:

[root@maestro Documents]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_maestro-lv_root
26G 26G 0 100% /
tmpfs 435M 72K 435M 1% /dev/shm
/dev/sda1 485M 64M 396M 14% /boot

Madhu Desai 07-11-2013 07:07 AM

Code:

[root@maestro Documents]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_maestro-lv_root
26G 26G 0 100% /
tmpfs 435M 72K 435M 1% /dev/shm
/dev/sda1 485M 64M 396M 14% /boot

There you go, out of 26GB, your '/' file system has '0' space available and has been used full 100%. If you have no dedicated filesystem for /var, then /var is hosted in /

Delete some unwanted files anywhere in '/' filesystem to make room for yum to cache downloaded files.

windstory 07-11-2013 07:14 AM

1 Attachment(s)
I've found out my problem. I've copied 30G hdd which is installed Scientific Linux to 250G hdd. Then I got this sturcture of hdd as attached. I have 218G free space.

Please let me know how to include this free space into LVM.

Madhu Desai 07-11-2013 08:05 AM

You can follow these steps. Here I'll assume you want add available free space(218 gb) to existing Logical Volume '/dev/mapper/vg_maestro-lv_root'

Step 1: Make a partition and mark that partition as 0x8e from available free space.
Code:

# fdisk /dev/sda

Command (m for help): n

Command action
  e  extended
  p  primary partition (1-4)

p

Partition number (1-4):3

First cylinder....: <ENTER>
Last cylinder.....: <ENTER>

Command (m for help): t

Partition number (1-4): 3

Hex code (type L to list codes): 8e

Command (m for help): w

Step 2: Re-read The Partition Table
Code:

# partprobe /dev/sda
Step 3: Create Physical Volume
Code:

# pvcreate /dev/sda3
Step 4: Add Physical volume to Volume Group
Code:

# vgextend vg_maestro /dev/sda3
Step 5: Extend Logical Volume (/)
Code:

# lvextend -l +100%FREE /dev/vg_maestro/lv_root
# resize2fs -f /dev/vg_maestro/lv_root
# sync

Step 6: Reboot
Code:

# reboot
You're done. Be carefull though, LVM is little headache.

windstory 07-11-2013 08:44 AM

1 Attachment(s)
Thanks a lot!
It works.

The result is at the attached picture, and this.


Quote:

[root@maestro Documents]# fdisk -l

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 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: 0x0003efaa

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 3917 30944256 8e Linux LVM
/dev/sda3 3918 30401 212732730 3 XENIX usr
/dev/sda4 3917 3917 6022+ 83 Linux

Partition table entries are not in disk order

Disk /dev/mapper/vg_maestro-lv_root: 245.3 GB, 245291286528 bytes
255 heads, 63 sectors/track, 29821 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_maestro-lv_swap: 4227 MB, 4227858432 bytes
255 heads, 63 sectors/track, 514 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 the "yum -y update" command is working now.

I appreciate you for kind and detailed guide.

Madhu Desai 07-11-2013 09:55 AM

Glad it helped :)


All times are GMT -5. The time now is 08:48 AM.