Udgivet i

Swap area in OpenSUSE

First create an 1Gigabyte file.

opensuse:~# dd if=/dev/zero of=/swap   bs=1024 count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes (1.0 GB) copied, 28.7256 s, 35.6 MB/s

DD command to create the 1G file basically writing “0” into the file swap_1 in the “/” file system.

Create SWAP area

opensuse:~ # mkswap /swap
Setting up swapspace version 1, size = 999996 KiB
no label, UUID=4aada58e-d6f7-4053-adf1-8d4c79122d36

That sets up the file as a swap area.

Now, we’ll simply enable the swapfile, so that the system can start paging physical memory pages onto it.

opensuse:~ # swapon /swap

The system should now have an additional 1Gigabyte of swap area. Check it.

opensuse:~ # free -tom
total       used       free     shared    buffers     cached
Mem:           998        973         24          0         20        795
Swap:         1716          0       1716
Total:        2714        973       1741

We now have 1.7Gigabytes of swap area.

To confirm the swap areas we have

opensuse:~ # swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/system-swap                 partition       757752  0       -1
/swap                                      file            999992  0       -2

To make it permanent, we need to add an entry to the /etc/fstab file.:

/swap       swap                 swap       defaults              0 0

Where /swap is our new swap file and it instructs the system to mount it at system startup as a swap area.

Udgivet i

yum Error:rpmdb open failed

rpmdb: PANIC: fatal region error detected; run recovery
error: db3 error(-30974) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 - (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed

This is how I fixed my problem.

This is quite the messy situation. You may fix this by cleaning out rpm database. To minimize risk, make a backup of files in /var/lib/rpm/ using cp command:

mkdir /root/backups.rpm.mm_dd_yyyy/
cp -avr /var/lib/rpm/ /root/backups.rpm.mm_dd_yyyy/

To fix this problem, try:

# rm -f /var/lib/rpm/__db*
# db_verify /var/lib/rpm/Packages
# rpm --rebuilddb
# yum clean all

Verify that error has gone with the following yum command

# yum update

https://unix.stackexchange.com/questions/198703/yum-errorrpmdb-open-failed