Portál AbcLinuxu, 5. května 2025 00:10

Dotaz: Obnova reiserfs

22.5.2005 10:17 kavol | skóre: 28
Obnova reiserfs
Přečteno: 481×
Odpovědět | Admin
zdravím,

chybou v jádře se mi dostal filesystém (reiserfs 3.6) do nekonsistentního stavu; po rebootu na mě zařval, že se mu to nepovedlo opravit a ať spustím reiserfsck --rebuild-tree, což byl konec použitelnosti toho disku, neboť skončil řvoucí, že nemá dostatek místa

jelikož rozdělení disku vypadá následovně:
Zařízení Boot      Start         End      Blocks   Id  System
/dev/hdd1   *           1       24255   194828256   83  Linux
/dev/hdd2           24256       24321      530145   82  Linux swap / Solaris
chtěl jsem to zkusit řešit zrušením swapu a roztažením první partition na celý disk, ale parted na to nezafungoval a fdisk i sfdisk se chovají poněkud destruktivně - přesněji po jejich zásahu mi reiserfsck vždy zařve, že nemůže najít superblock, přičemž debugreiserfs, který to doporučí, je také úplně mimo a nic nenajde :-(

pokus o reiserfsck --rebuild-sb má za následek jedině to, že mi reiserfsck --rebuild-tree po hodině a půl chrochtání řekne, že nenašel metadata ... dělal jsem zhruba následující:
# reiserfsck --rebuild-sb /dev/hdb1
reiserfsck 3.6.19 (2003 www.namesys.com)

*************************************************************
... blabla varování ...
*************************************************************

Will check superblock and rebuild it if needed
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes

reiserfs_open: the reiserfs superblock cannot be found on /dev/hdb1.

what the version of ReiserFS do you use[1-4]
        (1)   3.6.x
        (2) >=3.5.9 (introduced in the middle of 1999) (if you use linux 2.2, choose this one)
        (3) < 3.5.9 converted to new format (don't choose if unsure)
        (4) < 3.5.9 (this is very old format, don't choose if unsure)
        (X)   exit
1

Enter block size [4096]:


No journal device was specified. (If journal is not available, re-run with --no-journal-available option specified).
Is journal default? (y/n)[y]:

Did you use resizer(y/n)[n]: y

Enter partition size [48839600]:
rebuild-sb: no uuid found, a new uuid was generated (b09ba33c-d928-43f7-970d-ac03e02f2f74)

rebuild-sb: You either have a corrupted journal or have just changed
the start of the partition with some partition table editor. If you are
sure that the start of the partition is ok, rebuild the journal header.
Do you want to rebuild the journal header? (y/n)[n]: y
Reiserfs super block in block 16 on 0x341 of format 3.6 with standard journal
Count of blocks on the device: 48839600
Number of bitmaps: 1491
Blocksize: 4096
Free blocks (count of blocks - used [journal, bitmaps, data, reserved] blocks): 0
Root block: 0
Filesystem is NOT clean
Tree height: 0
Hash function used to sort names: not set
Objectid map size 0, max 972
Journal parameters:
        Device [0x0]
        Magic [0x0]
        Size 8193 blocks (including 1 for journal header) (first block 18)
        Max transaction length 1024 blocks
        Max batch size 900 blocks
        Max commit age 30
Blocks reserved by journal: 0
Fs state field: 0x1:
         some corruptions exist.
sb_version: 2
inode generation number: 0
UUID: b09ba33c-d928-43f7-970d-ac03e02f2f74
LABEL:
Set flags in SB:
Is this ok ? (y/n)[n]: y
The fs may still be unconsistent. Run reiserfsck --check.

# reiserfsck --check /dev/hdb1
reiserfsck 3.6.19 (2003 www.namesys.com)

*************************************************************
... blabla varování ...
*************************************************************

Will read-only check consistency of the filesystem on /dev/hdb1
Will put log info to 'stdout'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
###########
reiserfsck --check started at Sat May 21 23:04:19 2005
###########
Replaying journal..
No transactions found
Checking internal tree..

Bad root block 0. (--rebuild-tree did not complete)

Neúspěšně ukončen (SIGABRT)
# reiserfsck --rebuild-tree -l /root/recovery.log /dev/hdb1
reiserfsck 3.6.19 (2003 www.namesys.com)

*************************************************************
... blabla varování ...
*************************************************************

Will rebuild the filesystem (/dev/hdb1) tree
Will put log info to '/root/recovery.log'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
Replaying journal..
No transactions found
###########
reiserfsck --rebuild-tree started at Sat May 21 23:05:02 2005
###########

Pass 0:
Loading on-disk bitmap .. ok, 22665497 blocks marked used
Skipping 9701 blocks (super block, journal, bitmaps) 36212849 blocks will be read
0%....20%....40%....60%....80%....100%                        left 0, 8421 /sec
Selected hash ("r5") does not match to the hash set in the super block (not set).
        "r5" hash is selected
Flushing..finished
        Read blocks (but not data blocks) 36212849
                Leaves among those 0
                Objectids found 2

Pass 1 (will try to insert 0 leaves):
Looking for allocable blocks .. finished

Flushing..finished
        0 leaves read
                0 inserted
Flushing..finished


No reiserfs metadata found.  If you are sure that you had the reiserfs
on this partition,  then the start  of the partition  might be changed
or all data were wiped out. The start of the partition may get changed
by a partitioner  if you have used one.  Then you probably rebuilt the
superblock as there was no one.  Zero the block at 64K offset from the
start of the partition (a new super block you have just built) and try
to move the start of the partition a few cylinders aside  and check if
debugreiserfs /dev/xxx detects a reiserfs super block. If it does this
is likely to be the right super block version.
If this makes you nervous, try  www.namesys.com/support.html,  and for
$25 the author of fsck,  or a colleague  if he is out,  will  step you
through it all.

Neúspěšně ukončen (SIGABRT)
tak nevím, co s tím - když na tu velikost partition nešahám, tak vždycky skončí s hláškou o nedostatku místa, když se pokusím to zvětšit, tak si zas neporadí se superblockem ... a nejvíc deptající na tom je, že překopírování celého toho filesystému trvá přes 6 hodin (nechci zlikvidovat originál ještě víc, než je) a jakýkoliv experiment s --rebuild-tree další hodinu a půl :-(

dík za každou radu (kromě toho, že mám obětovat 25 $ Namesysu ;-))
Nástroje: Začni sledovat (2) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

22.5.2005 12:36 kavol | skóre: 28
Rozbalit Rozbalit vše Re: Obnova reiserfs
Odpovědět | | Sbalit | Link | Blokovat | Admin
jo ještě ta hláška s tím nedostatkem místa (když se tu partition nepokouším zvětšit) -
# reiserfsck --rebuild-tree -l /root/recovery.log /dev/hdb1
reiserfsck 3.6.19 (2003 www.namesys.com)

*************************************************************
** Do not  run  the  program  with  --rebuild-tree  unless **
** something is broken and MAKE A BACKUP  before using it. **
** If you have bad sectors on a drive  it is usually a bad **
** idea to continue using it. Then you probably should get **
** a working hard drive, copy the file system from the bad **
** drive  to the good one -- dd_rescue is  a good tool for **
** that -- and only then run this program.                 **
** If you are using the latest reiserfsprogs and  it fails **
** please  email bug reports to reiserfs-list@namesys.com, **
** providing  as  much  information  as  possible --  your **
** hardware,  kernel,  patches,  settings,  all reiserfsck **
** messages  (including version),  the reiserfsck logfile, **
** check  the  syslog file  for  any  related information. **
** If you would like advice on using this program, support **
** is available  for $25 at  www.namesys.com/support.html. **
*************************************************************

Will rebuild the filesystem (/dev/hdb1) tree
Will put log info to '/root/recovery.log'

Do you want to run this program?[N/Yes] (note need to type Yes if you do):Yes
Replaying journal..
Reiserfs journal '/dev/hdb1' in blocks [18..8211]: 0 transactions replayed
###########
reiserfsck --rebuild-tree started at Sun May 22 10:18:14 2005
###########

Pass 0:
Loading on-disk bitmap .. ok, 48605254 blocks marked used
Skipping 9697 blocks (super block, journal, bitmaps) 48595557 blocks will be read
0%....20%....40%....60%....80%....100%                        left 0, 9754 /sec
        "r5" hash is selected
Flushing..finished
        Read blocks (but not data blocks) 48595557
                Leaves among those 510383
                        - corrected leaves 2
                        - leaves all contents of which could not be saved and deleted 1
                Objectids found 193501

Pass 1 (will try to insert 510382 leaves):
Looking for allocable blocks .. finished
0%....20%....40%....60%....80%....100%                         left 0, 743 /sec
Flushing..finished
        510382 leaves read
                58749 inserted
                451633 not inserted
        non-unique pointers in indirect items (zeroed) 1

Pass 2:
0%....20%....40%..Not enough allocable blocks, checking bitmap...there are 0 allocable blocks, btw

out of disk space
Neúspěšně ukončen (SIGABRT)
24.1.2007 11:42 kavol | skóre: 28
Rozbalit Rozbalit vše Re: Obnova reiserfs
Odpovědět | | Sbalit | Link | Blokovat | Admin
kdyby to někoho zajímalo :-) ... téměř po dvou letech konečně vyřešeno - všiml jsem si, že (před nějakou dobou) vyšlo reiserfsprogs-3.6.20, fsck.reiserfs -S --rebuild-tree /dev/hdc1 zafungovalo (s velmi mírnými ztrátami ve struktuře, ale data jsou alespoň v lost+found)
24.1.2007 12:53 Aleš Kapica | skóre: 52 | blog: kenyho_stesky | Ostrava
Rozbalit Rozbalit vše Re: Obnova reiserfs
No pravdu díc, lepší než nic. Když jsem minulý týden zápolil s něčím podobným, tak to skončilo tím, že sice hodně dat zůstalo zachováno, jenže na hromadě v lost+found. Tak jsem z toho kuchnul jen soubor /var/lib/dpkg/status, vypreparoval z něj které balíky tam vlastně byly nainstalované a po přeformátování to nainstaloval znova. Pořád s tím bylo míň práce než to nějak zachraňovat. Ovšem to se týkalo systémového disku. Diskové oddíly s daty porušené nebyly.

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.