1

All of the files on my usb stick were deleted by accident (rm -r) but I'm having trouble recovering. When I try to run ext4magic it says "filesystem has no journal" and it mounts as ext2 only. I suspect this happened because everytime it was mounted under initramfs it was only mounted as ext2 instead of ext4, but the last mount should have been as an ext4 filesystem. Is there a way to recover the journal from one of the superblocks?

I tried running fsck to recover an alternate superblock:

#fsck.ext2 -p -b 229376 -B 4096
11/65536 files (0.0% non-contiguous), 4440/262144 blocks

But then testdisk shows all of the files as 0 bytes.

I tried using photorec on the drive, but it's a complete mess and some files split up into multiple 10.5 MB sections with no way to know which file goes where.

Here's my dumpe2fs:

Filesystem volume name:   <none>
Last mounted on:          /media/ubuntu/e26d222d-b6d6-4272-bd79-e66f757699dd
Filesystem UUID:          e26d222d-b6d6-4272-bd79-e66f757699dd
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags:         signed_directory_hash 
Default mount options:    user_xattr acl
Filesystem state:         not clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              65536
Block count:              262144
Reserved block count:     13107
Free blocks:              55331
Free inodes:              64564
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      63
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Filesystem created:       Tue Mar 19 21:17:42 2019
Last mount time:          Sun May  5 16:35:27 2019
Last write time:          Sun May  5 18:20:12 2019
Mount count:              0
Maximum mount count:      -1
Last checked:             Sun May  5 18:20:12 2019
Check interval:           0 (<none>)
Lifetime writes:          7593 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     32
Desired extra isize:      32
Default directory hash:   half_md4
Directory Hash Seed:      aade83a7-e0c9-47b3-8479-805d496fc7ee


Group 0: (Blocks 0-32767)
  Primary superblock at 0, Group descriptors at 1-1
  Reserved GDT blocks at 2-64
  Block bitmap at 65 (+65), Inode bitmap at 66 (+66)
  Inode table at 67-578 (+67)
  32187 free blocks, 8182 free inodes, 1 directories
  Free blocks: 580-583, 585-32767
  Free inodes: 11-8192
Group 1: (Blocks 32768-65535)
  Backup superblock at 32768, Group descriptors at 32769-32769
  Reserved GDT blocks at 32770-32832
  Block bitmap at 32833 (+65), Inode bitmap at 32834 (+66)
  Inode table at 32835-33346 (+67)
  32189 free blocks, 8192 free inodes, 0 directories
  Free blocks: 33347-65535
  Free inodes: 8193-16384
Group 2: (Blocks 65536-98303)
  Block bitmap at 65536 (+0), Inode bitmap at 65537 (+1)
  Inode table at 65538-66049 (+2)
  32254 free blocks, 8192 free inodes, 0 directories
  Free blocks: 66050-98303
  Free inodes: 16385-24576
Group 3: (Blocks 98304-131071)
  Backup superblock at 98304, Group descriptors at 98305-98305
  Reserved GDT blocks at 98306-98368
  Block bitmap at 98369 (+65), Inode bitmap at 98370 (+66)
  Inode table at 98371-98882 (+67)
  32189 free blocks, 8192 free inodes, 0 directories
  Free blocks: 98883-131071
  Free inodes: 24577-32768
Group 4: (Blocks 131072-163839)
  Block bitmap at 131072 (+0), Inode bitmap at 131073 (+1)
  Inode table at 131074-131585 (+2)
  32254 free blocks, 8192 free inodes, 0 directories
  Free blocks: 131586-163839
  Free inodes: 32769-40960
Group 5: (Blocks 163840-196607)
  Backup superblock at 163840, Group descriptors at 163841-163841
  Reserved GDT blocks at 163842-163904
  Block bitmap at 163905 (+65), Inode bitmap at 163906 (+66)
  Inode table at 163907-164418 (+67)
  32189 free blocks, 8192 free inodes, 0 directories
  Free blocks: 164419-196607
  Free inodes: 40961-49152
Group 6: (Blocks 196608-229375)
  Block bitmap at 196608 (+0), Inode bitmap at 196609 (+1)
  Inode table at 196610-197121 (+2)
  32254 free blocks, 8192 free inodes, 0 directories
  Free blocks: 197122-229375
  Free inodes: 49153-57344
Group 7: (Blocks 229376-262143)
  Backup superblock at 229376, Group descriptors at 229377-229377
  Reserved GDT blocks at 229378-229440
  Block bitmap at 229441 (+65), Inode bitmap at 229442 (+66)
  Inode table at 229443-229954 (+67)
  32189 free blocks, 8192 free inodes, 0 directories
  Free blocks: 229955-262143
  Free inodes: 57345-65536

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.