# [solved] cryptsetup+XFS are down after power break

## ial

My encrypted partition (kernel option) refuses to mount after computer power break.

The first of two consecutive commands required goes ok:

```
cryptsetup --verbose  create II2 /dev/hda2

Enter passphrase:
```

after entering the correct passphrase the device /dev/mapper/II2 is created in the /dev directory.

But the next step, mounting (as usual) yields unseen so far the error message:

```
mount  /dev/mapper/II2  /mnt/a2.II2

mount: wrong fs type, bad option, bad superblock on /dev/mapper/II2,

       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try

       dmesg | tail  or so
```

dmesg, as suggested there, shows no new info as compared to the state before these 2 commands. Also other logs reveal no new info. 

Then I want to check xfs filesystem and try this command:

```
# fsck.xfs /dev/mapper/II2

If you wish to check the consistency of an XFS filesystem or

repair a damaged filesystem, see xfs_check(8) and xfs_repair(8).
```

So I follow the suggestions:

```
# xfs_check /dev/mapper/II2

xfs_check: unexpected XFS SB magic number 0x00000000

xfs_check: read failed: Invalid argument

xfs_check: data size check failed

cache_node_purge: refcount was 1, not zero (node=0xff2c20)

xfs_check: cannot read root inode (22)

bad superblock magic number 0, giving up
```

And then:

```
# xfs_repair -v /dev/mapper/II2

Phase 1 - find and verify superblock...

bad primary superblock - bad magic number !!!

attempting to find secondary superblock...

.................................Sorry, could not find valid secondary superblock

Exiting now.
```

So, what about this encrypted xfs filesystem now? Is it realy entirely lost?Last edited by ial on Fri Sep 25, 2009 10:45 am; edited 1 time in total

----------

## ial

I apologize, I misinformed you:  the filesystem is not xfs but jfs. After applying fsck.jfs the fs has been corrected and now is fully accessible.

Please forgive me for making just a mess in this forum. Administrator, please, I request you had better erase this thread. Thank you.

----------

