Discussion:
Pomóżcie mi naprawić bazę RPM-a - coś mi się solidnie zrąbało w systemie
(Wiadomość utworzona zbyt dawno temu. Odpowiedź niemożliwa.)
Łukasz Maśko
2015-10-12 11:13:02 UTC
Permalink
Zaczęło się od instalacji glibc 2.22-7, co poskutkowało tym, że system
przestał mi wstawać. Jedynie wstaje w single. Próbowałem wrócić do 2.22-6.
Ściągnąłem paczki ręcznie na dysk, zrobiłem rpm -Uvh --oldpackage ... i niby
poszło. Ale... zamiast najpierw napisać sync (jestem w single), wcisnąłem od
razu Alt-Ctrl-Del. Komputer się natychmiast zrestartował. Od tej pory nie
jestem w stanie niczego sensownego zrobić z rpm-em. Na systemie zamontowanym
w read-only wypisuje mi chociaż rpm -qa. Jeśli ten sam system zamontuję w
rw, mam takie coś:

rpmdb: BDB2034 unable to allocate memory for mutex; resize mutex region
error: db_init:db3.c:1179: dbenv->open(12): Cannot allocate memory
error: cannot open Packages(0) index: Cannot allocate memory(12)
DB: Berkeley DB 5.2.42: (February 29, 2012)
error: cannot open Packages database in /var/lib/rpm

rpm --rebuilddb oczywiście nie działa, efekt jak powyżej.

Pomóżcie mi proszę odbudować tą bazę. Nie mogę sobie pozwolić na ponowną
instalację wszystkiego. Najbardziej mnie dziwi, że na systemie plików
zamontowanym w read-only zawartość bazy jest wypisywana. Tylko co mi po tym,
jak nie można wykonać na niej żadnej operacji...
--
Łukasz Maśko _o)
Lukasz.Masko(at)ipipan.waw.pl /\\
Registered Linux User #61028 _\_V
Mateusz Korniak
2015-10-12 11:30:01 UTC
Permalink
Post by Łukasz Maśko
rpmdb: BDB2034 unable to allocate memory for mutex; resize mutex region
error: db_init:db3.c:1179: dbenv->open(12): Cannot allocate memory
error: cannot open Packages(0) index: Cannot allocate memory(12)
DB: Berkeley DB 5.2.42: (February 29, 2012)
error: cannot open Packages database in /var/lib/rpm
rpm --rebuilddb oczywiście nie działa, efekt jak powyżej.
Pomóżcie mi proszę odbudować tą bazę. Nie mogę sobie pozwolić na ponowną
instalację wszystkiego. Najbardziej mnie dziwi, że na systemie plików
zamontowanym w read-only zawartość bazy jest wypisywana. Tylko co mi po tym,
jak nie można wykonać na niej żadnej operacji...
Zrób kopie /var/lib/rpm.

Zobacz jaki efekt daje:

/var/lib/rpm]# db5.2_verify A* Ba* C* Dirnames F* G* I* N* O* P* R* S* T* V*

Coś innego niż:

BDB5105 Verification of * succeeded.

?
A szczególnie dla Packages?

Potem możesz spróbować:

db5.2_recover -vh /var/lib/rpm
rpm --rebuilddb -vv


Jak nie zadziała, a jakoś widzisz listę pakietów to odbududowa bazy rpm'a via:

rpm -qa --qf "%{NAME}\n" >packages.txt
poldek --install --justdb --pset=packages.txt
--
Mateusz Korniak
"(...) mam brata - poważny, domator, liczykrupa, hipokryta, pobożniś,
krótko mówiąc - podpora społeczeństwa."
Nikos Kazantzakis - "Grek Zorba"
Łukasz Maśko
2015-10-12 12:18:46 UTC
Permalink
Dnia poniedziałek, 12 października 2015 13:30:01 Mateusz Korniak pisze:
[...]
Post by Mateusz Korniak
Zrób kopie /var/lib/rpm.
/var/lib/rpm]# db5.2_verify A* Ba* C* Dirnames F* G* I* N* O* P* R* S*
T* V*
BDB5105 Verification of * succeeded.
?
A szczególnie dla Packages?
Baaardzo dziękuję za odzew. Na wszystkich plikach mam takie coś:

# db5.2_verify Packages
db5.2_verify: BDB2034 unable to allocate memory for mutex; resize mutex
region
db5.2_verify: Packages: Cannot allocate memory
BDB2034 Verification of Packages failed.

Po czym proces db5.2_verify usypia (w ps ax status jest S+) i można go
jedynie ubić przez kill -9.
--
Łukasz Maśko _o)
Lukasz.Masko(at)ipipan.waw.pl /\\
Registered Linux User #61028 _\_V
Łukasz Maśko
2015-10-12 13:11:15 UTC
Permalink
Post by Łukasz Maśko
[...]
Post by Mateusz Korniak
Zrób kopie /var/lib/rpm.
/var/lib/rpm]# db5.2_verify A* Ba* C* Dirnames F* G* I* N* O* P* R* S*
T* V*
BDB5105 Verification of * succeeded.
?
A szczególnie dla Packages?
# db5.2_verify Packages
db5.2_verify: BDB2034 unable to allocate memory for mutex; resize mutex
region
db5.2_verify: Packages: Cannot allocate memory
BDB2034 Verification of Packages failed.
Po czym proces db5.2_verify usypia (w ps ax status jest S+) i można go
jedynie ubić przez kill -9.
Dodam jeszcze, że jeśli usunę pliki __db*, zrobię db5.2_recover to mam tak:

# db5.2_recover -vh /var/lib/rpm
BDB2526 Finding last valid log LSN: file: 1 offset 28

(to dobrze czy źle?) A potem:

# rpm --rebuilddb -vv
D: pool fd: created size 212 limit -1 flags 0
D: pool iob: created size 24 limit -1 flags 0
D: pool mire: created size 88 limit -1 flags 0
D: pool lua: created size 36 limit -1 flags 0
D: pool ts: created size 724 limit -1 flags 0
D: pool db: created size 188 limit -1 flags 0
D: pool dbi: created size 312 limit -1 flags 0
D: rpmdb: cpus 2 physmem 2007Mb
D: opening db environment /var/lib/rpm/Packages
create:thread:lock:log:mpool:txn
D: opening db index /var/lib/rpm/Packages create:thread:auto_commit
mode=0x2
rpmdb: BDB2506 file /var/lib/rpm/Packages has LSN 340/2474941, past end of
log at 1/64
rpmdb: BDB2507 Commonly caused by moving a database from one database
environment
rpmdb: BDB2508 to another without clearing the database LSNs, or by removing
all of
rpmdb: BDB2509 the log files from a database environment
rpmdb: BDB0641 __db_meta_setup: /var/lib/rpm/Packages: unexpected file type
or format
D: closed db index /var/lib/rpm/Packages
D: closed db environment /var/lib/rpm/Packages
error: nie można otworzyć indeksu Packages(0): Zły argument(22)
DB: Berkeley DB 5.2.42: (February 29, 2012)
error: nie można otworzyć bazy danych Packages w /var/lib/rpm
D: pool tsi: created size 28 limit -1 flags 0
D: pool tsi: reused 1, alloc'd 1, free'd 1 items.
D: pool ts: reused 0, alloc'd 1, free'd 1 items.
D: pool db: reused 0, alloc'd 1, free'd 1 items.
D: pool dbi: reused 0, alloc'd 1, free'd 1 items.
D: pool lua: reused 0, alloc'd 1, free'd 1 items.
D: pool mire: reused 0, alloc'd 1, free'd 1 items.
D: pool iob: reused 0, alloc'd 1, free'd 1 items.
D: pool fd: reused 20, alloc'd 2, free'd 2 items.
D: exit code: -2

I to już dobrze nie wygląda, bo coś jakby niespójny format albo popsuty plik
Packages. Nie wiem, co z tym dalej zrobić :-/


PS. W odwodzie mam listę pakietów, to udało mi się wyciągnąć (ale gdy katalog
jest RO).
--
Łukasz Maśko _o)
Lukasz.Masko(at)ipipan.waw.pl /\\
Registered Linux User #61028 _\_V
Ubuntu: staroafrykańskie słowo oznaczające "Nie umiem zainstalować Debiana"
Łukasz Maśko
2015-10-12 13:19:06 UTC
Permalink
Dnia poniedziałek, 12 października 2015 15:11:15 Łukasz Maśko pisze:
[...]
Post by Łukasz Maśko
PS. W odwodzie mam listę pakietów, to udało mi się wyciągnąć (ale gdy
katalog jest RO).
Przy okazji - tutaj będzie i tak kłopot, bo mam zainstalowanych trochę
pakietów już nieobecnych w repozytorium albo pochodzących z własnej
kompilacji, przez co poldek sobie nie poradzi jak należy. K...
--
Łukasz Maśko _o)
Lukasz.Masko(at)ipipan.waw.pl /\\
Registered Linux User #61028 _\_V
Mateusz Korniak
2015-10-12 13:27:51 UTC
Permalink
A jak nie usuniesz żadnego pliku i spróbujesz
db5.2_recover -vh /var/lib/rpm
?
--
Mateusz Korniak
"(...) mam brata - poważny, domator, liczykrupa, hipokryta, pobożniś,
krótko mówiąc - podpora społeczeństwa."
Nikos Kazantzakis - "Grek Zorba"
Łukasz Maśko
2015-10-12 13:30:24 UTC
Permalink
Post by Mateusz Korniak
Post by Łukasz Maśko
Dodam jeszcze, że jeśli usunę pliki __db*, zrobię db5.2_recover to mam
A jak nie usuniesz żadnego pliku i spróbujesz
db5.2_recover -vh /var/lib/rpm
?
# db5.2_recover -vh /var/lib/rpm
BDB2526 Finding last valid log LSN: file: 1 offset 1807751
db5.2_recover: BDB2506 file /var/lib/rpm/Version has LSN 192/6043244, past
end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Release has LSN 318/4572456, past
end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Arch has LSN 336/5382288, past end
of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Os has LSN 338/6312598, past end of
log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Group has LSN 306/6162452, past end
of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Providename has LSN 336/2221966,
past end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Requirename has LSN 337/5808451,
past end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Obsoletename has LSN 292/5774727,
past end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Dirnames has LSN 339/8990213, past
end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Installtid has LSN 335/3741392, past
end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Sigmd5 has LSN 281/8367081, past end
of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Filedigests has LSN 181/9543169,
past end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Packagecolor has LSN 337/7500803,
past end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Filepaths has LSN 339/9038611, past
end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Sha1header has LSN 318/726081, past
end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Basenames has LSN 338/5161255, past
end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Nvra has LSN 295/211430, past end of
log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Name has LSN 285/6229531, past end
of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
db5.2_recover: BDB2506 file /var/lib/rpm/Packages has LSN 340/2474941, past
end of log at 1/1807751
db5.2_recover: BDB2507 Commonly caused by moving a database from one database
environment
db5.2_recover: BDB2508 to another without clearing the database LSNs, or by
removing all of
db5.2_recover: BDB2509 the log files from a database environment
BDB1518 Recovery complete at Mon Oct 12 15:29:57 2015
BDB1519 Maximum transaction ID 0 recovery checkpoint [1][1809611]
--
Łukasz Maśko _o)
Lukasz.Masko(at)ipipan.waw.pl /\\
Registered Linux User #61028 _\_V
Ubuntu: staroafrykańskie słowo oznaczające "Nie umiem zainstalować Debiana"
Łukasz Maśko
2015-10-12 13:31:55 UTC
Permalink
Post by Mateusz Korniak
Post by Łukasz Maśko
Dodam jeszcze, że jeśli usunę pliki __db*, zrobię db5.2_recover to mam
A jak nie usuniesz żadnego pliku i spróbujesz
db5.2_recover -vh /var/lib/rpm
?
Tfu, po winno być to:

# db5.2_recover -vh /var/lib/rpm
BDB2526 Finding last valid log LSN: file: 1 offset 1809703
BDB1518 Recovery complete at Mon Oct 12 15:31:18 2015
BDB1519 Maximum transaction ID 0 recovery checkpoint [1][1809611]

(poprzednie jest BEZ tych __db*)
--
Łukasz Maśko _o)
Lukasz.Masko(at)ipipan.waw.pl /\\
Registered Linux User #61028 _\_V
Ubuntu: staroafrykańskie słowo oznaczające "Nie umiem zainstalować Debiana"
Mateusz Korniak
2015-10-12 13:44:05 UTC
Permalink
Post by Łukasz Maśko
Post by Mateusz Korniak
A jak nie usuniesz żadnego pliku i spróbujesz
db5.2_recover -vh /var/lib/rpm
BDB2526 Finding last valid log LSN: file: 1 offset 1809703
BDB1518 Recovery complete at Mon Oct 12 15:31:18 2015
BDB1519 Maximum transaction ID 0 recovery checkpoint [1][1809611]
A czy teraz przechodzi:

rpm --rebuilddb -vv

i

/var/lib/rpm]# db5.2_verify A* Ba* C* Dirnames F* G* I* N* O* P* R* S* T* V*

?
--
Mateusz Korniak
"(...) mam brata - poważny, domator, liczykrupa, hipokryta, pobożniś,
krótko mówiąc - podpora społeczeństwa."
Nikos Kazantzakis - "Grek Zorba"
Łukasz Maśko
2015-10-12 13:48:26 UTC
Permalink
Post by Mateusz Korniak
Post by Łukasz Maśko
Post by Mateusz Korniak
A jak nie usuniesz żadnego pliku i spróbujesz
db5.2_recover -vh /var/lib/rpm
BDB2526 Finding last valid log LSN: file: 1 offset 1809703
BDB1518 Recovery complete at Mon Oct 12 15:31:18 2015
BDB1519 Maximum transaction ID 0 recovery checkpoint [1][1809611]
rpm --rebuilddb -vv
i
/var/lib/rpm]# db5.2_verify A* Ba* C* Dirnames F* G* I* N* O* P* R* S*
T* V*
?
Nie. Każde z tego notorycznie się pluje o mutexy, dokładnie tak jak w
pierwszym mailu.

Czy można jakoś wykorzystać fakt, że o ile rpm -qa i dowolne inne qpm -q
wykłada się, gdy odpalane z roota, to działa gdy odpalane ze zwykłego usera?
--
Łukasz Maśko _o)
Lukasz.Masko(at)ipipan.waw.pl /\\
Registered Linux User #61028 _\_V
Loading...