xfs
[Top] [All Lists]

wrong logstart value (was: xfs_repair trouble)

To: linux-xfs@xxxxxxxxxxx
Subject: wrong logstart value (was: xfs_repair trouble)
From: Willi Langenberger <wlang@xxxxxxxxxxxxx>
Date: Mon, 13 May 2002 09:52:27 +0200
Cc: Stephen Lord <lord@xxxxxxx>
Reply-to: Willi.Langenberger@xxxxxxxxxxxxx
Sender: owner-linux-xfs@xxxxxxxxxxx
Hi!


Maybe i found the reason for my xfs_repair troubles...

The log seems to overlap the root inode:

  # xfs_db -r /dev/sdb
  xfs_db: sb 0
  xfs_db: p
  magicnum = 0x58465342
  blocksize = 4096
  dblocks = 2000000
  rblocks = 0
  rextents = 0
  uuid = 2604c50c-3a11-4d67-a80c-156580239afb
  logstart = 4
  rootino = 128
  rbmino = 129
  rsumino = 130
  rextsize = 16
  agblocks = 1000
  agcount = 2000
  rbmblocks = 0
  logblocks = 512
  versionnum = 0x2084
  sectsize = 512
  inodesize = 256
  inopblock = 16
  fname = "\000\000\000\000\000\000\000\000\000\000\000\000"
  blocklog = 12
  sectlog = 9
  inodelog = 8
  inopblog = 4
  agblklog = 10
  rextslog = 0
  inprogress = 0
  imax_pct = 25
  icount = 154432
  ifree = 98649
  fdblocks = 1513350
  frextents = 0
  uquotino = 0
  gquotino = 0
  qflags = 0
  flags = 0
  shared_vn = 0
  inoalignmt = 2
  unit = 0
  width = 0
  dirblklog = 0

==> logstart=4, logblocks=512, rootino=128

  xfs_db: convert fsblock 4 daddr
  0x20 (32)

  xfs_db: convert ino 128 daddr
  0x40 (64)

Thus: zeroing the log destroys the root inode. Later on, xfs_repair
restores the root inode and corrupts the log...

  # cat /dev/zero | dd of=/dev/sdb bs=512 seek=32 count=1

(needed for xfs_repair to run -- otherwise it will hang in the loop in
xlog_find_tail, as described before)

  # xfs_repair -L /dev/sdb

(output of xfs_repair: http://slime.wu-wien.ac.at/xfs/repair.003.out)


My questions:

  * any idea, how this can happen?

  * (more important) is there a chance that i can correct the log
    region? how can i find out where the log really should be?

  * or, can i change my fs to use an external log? that way it would
    not destroy data...

For completeness, the mp structure:

(gdb) p *mp
$14 = {m_sb = {sb_magicnum = 1481003842, sb_blocksize = 4096,
    sb_dblocks = 2000000, sb_rblocks = 0, sb_rextents = 0,
    sb_uuid = "&\004Å\f:\021Mg¨\f\025e\200#\232û", sb_logstart = 4,
    sb_rootino = 128, sb_rbmino = 129, sb_rsumino = 130, sb_rextsize = 16,
    sb_agblocks = 1000, sb_agcount = 2000, sb_rbmblocks = 0,
    sb_logblocks = 512, sb_versionnum = 8324, sb_sectsize = 512,
    sb_inodesize = 256, sb_inopblock = 16,
    sb_fname = '\000' <repeats 11 times>, sb_blocklog = 12 '\f',
    sb_sectlog = 9 '\t', sb_inodelog = 8 '\b', sb_inopblog = 4 '\004',
    sb_agblklog = 10 '\n', sb_rextslog = 0 '\000', sb_inprogress = 0 '\000',
    sb_imax_pct = 25 '\031', sb_icount = 154432, sb_ifree = 98649,
    sb_fdblocks = 1513350, sb_frextents = 0, sb_uquotino = 0, sb_gquotino = 0,
    sb_qflags = 0, sb_flags = 0 '\000', sb_shared_vn = 0 '\000',
    sb_inoalignmt = 2, sb_unit = 0, sb_width = 0, sb_dirblklog = 0 '\000',
    sb_dummy = "\000\000\000\000\000\000"}, m_bsize = 8, m_agfrotor = 0,
  m_agirotor = 0, m_maxagi = 2000, m_rsumlevels = 0, m_rsumsize = 0,
  m_rbmip = 0x0, m_rsumip = 0x0, m_rootip = 0x0, m_dev = 2064, m_logdev = 0,
  m_rtdev = 0, m_dircook_elog = 0 '\000', m_blkbit_log = 15 '\017',
  m_blkbb_log = 3 '\003', m_agno_log = 11 '\013', m_agino_log = 14 '\016',
  m_inode_cluster_size = 8192, m_blockmask = 4095, m_blockwsize = 1024,
  m_blockwmask = 1023, m_alloc_mxr = {510, 340}, m_alloc_mnr = {255, 170},
  m_bmap_dmxr = {254, 254}, m_bmap_dmnr = {127, 127}, m_inobt_mxr = {255,
    510}, m_inobt_mnr = {127, 255}, m_ag_maxlevels = 2, m_bm_maxlevels = {5,
    3}, m_in_maxlevels = 2, m_perag = 0x80e7fc0, m_flags = 0, m_qflags = 0,
  m_attroffset = 120, m_da_node_ents = 510, m_ialloc_inos = 64,
  m_ialloc_blks = 4, m_litino = 156, m_inoalign_mask = 1, m_reservations = {
    tr_write = 74424, tr_itruncate = 107448, tr_rename = 305976,
    tr_link = 152832, tr_remove = 153144, tr_symlink = 158520,
    tr_create = 157880, tr_mkdir = 157880, tr_ifree = 14520,
    tr_ichange = 1592, tr_growdata = 27264, tr_swrite = 384,
    tr_addafork = 52664, tr_writeid = 384, tr_attrinval = 107136,
    tr_attrset = 22456, tr_attrrm = 54200, tr_clearagi = 640,
    tr_growrtalloc = 48128, tr_growrtzero = 4224, tr_growrtfree = 5760},
  m_maxicount = 8000000, m_dalign = 0, m_swidth = 0, m_sinoalign = 0,
  m_dir_magicpct = 1515, m_dirversion = 2 '\002', m_dirblksize = 4096,
  m_dirblkfsbs = 1, m_dirdatablk = 0, m_dirleafblk = 8388608,
  m_dirfreeblk = 16777216}

Thanks to all!


\wlang{}

-- 
Willi.Langenberger@xxxxxxxxxxxxx                 Fax: +43/1/31336/702
Zentrum fuer Informatikdienste, Wirtschaftsuniversitaet Wien, Austria


<Prev in Thread] Current Thread [Next in Thread>