0

If i want to mount this drive, i need to run e2fsck or fsck.ext4 after every boot. All data is visible and accessable after that.

uuid only appears in system listings after "fsck.ext4" or "e2fsck". The uuid appearing after "fsck.ext4" is inside fstab and after "sudo mount -a" it mounts successfully. But next boot i have to do "fsck.ext4" or "e2fsck" and mount again.

I remember accidentally deleting one small first partition on this disk through gparted usb. This is probably the reason for this behaviour, right? How to solve this problem?

FV42JOA:~$ sudo mount /dev/sdb /mnt/wsl/hdd10 mount: /mnt/wsl/hdd10: wrong fs type, bad option, bad superblock on /dev/sdc, missing codepage or helper program, or other error. ( before e2fsck)

lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 256G 0 disk / sdb 8:16 0 10.9T 0 disk

FV42JOA:~$ sudo fsck.ext4 /dev/sdb e2fsck 1.45.5 (07-Jan-2020) ext2fs_open2: Bad magic number in super-block fsck.ext4: Superblock invalid, trying backup blocks... Superblock needs_recovery flag is clear, but journal has data. Recovery flag not set in backup superblock, so running journal anyway. hdd4: recovering journal Pass 1: Checking inodes, blocks, and sizes ... Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information Free blocks count wrong for group #0 (30649, counted=1461). Fix<y>?

...( a lot of numbers after pressing "a" at "Fix?")

Free inodes count wrong for group #0 (21, counted=0). Fix? yes Free inodes count wrong for group #1 (32, counted=0). Fix? yes Free inodes count wrong for group #2 (32, counted=0). Fix? yes Free inodes count wrong for group #3 (32, counted=7). Fix? yes Free inodes count wrong (2861045, counted=2860935). Fix? yes Padding at end of inode bitmap is not set. Fix? yes Block bitmap differences: Group 0 block bitmap does not match checksum. FIXED. hdd4: ***** FILE SYSTEM WAS MODIFIED ***** hdd4: 121/2861056 files (0.8% non-contiguous), 2923633429/2929721344 blocks

FV42JOA:~$ sudo smartctl --all /dev/sdb smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.72-microsoft-standard-WSL2] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Vendor: WDC Product: WD121KRYZ-01W0RB Revision: 01.0 User Capacity: 12,000,138,625,024 bytes [12.0 TB] Logical block size: 512 bytes Physical block size: 4096 bytes LU is fully provisioned Rotation Rate: 7200 rpm Form Factor: 3.5 inches >> Terminate command early due to bad response to IEC mode page A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

FV42JOA:~$ sudo skdump /dev/sdb Device: sat16:/dev/sdb Type: 16 Byte SCSI ATA SAT Passthru Size: 11444224 MiB Awake: Operation not supported ATA SMART not supported.

FV42JOA:~$ sudo df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda 263174212 3337580 246398476 2% / /dev/sdb 11716272064 11691920404 24335276 100% /mnt/wsl/hdd10(after e2fsck and mount)

FV42JOA:~$ sudo hdparm -I /dev/sdb /dev/sdb: SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 07 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ATA device, with non-removable media Standards: Likely used: 1 Configuration: Logical max current cylinders 0 0 heads 0 0 sectors/track 0 0 -- Logical/Physical Sector size: 512 bytes device size with M = 1024*1024: 0 MBytes device size with M = 1000*1000: 0 MBytes cache/buffer size = unknown Capabilities: IORDY not likely Cannot perform double-word IO R/W multiple sector transfer: not supported DMA: not supported PIO: pio0 (after e2fsck and mount)

As requested by heynnema, i want to notice that i switched to ubuntu live usb and below is not the same disk constellation as everything above, i plugged some drives in and out.

In this case (fdisk below before fsck) i have this problem with disks /dev/sdb, /dev/sde and /dev/sdf

Disk /dev/loop0: 2.1 GiB, 2160009216 bytes, 4218768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 55.45 MiB, 58130432 bytes, 113536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 219 MiB, 229638144 bytes, 448512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 50.98 MiB, 53432320 bytes, 104360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 65.1 MiB, 68259840 bytes, 133320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 32.3 MiB, 33865728 bytes, 66144 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 111.81 GiB, 120034123776 bytes, 234441648 sectors
Disk model: Crucial_CT120M50
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 379DAC7C-9EF1-4077-B2C6-5828602E3F12

Device         Start       End  Sectors  Size Type
/dev/sda1       2048  39063551 39061504 18.6G Linux swap
/dev/sda2   39063552  78125055 39061504 18.6G Linux filesystem
/dev/sda3   78125056 117186559 39061504 18.6G Linux filesystem
/dev/sda4  117186560 118163455   976896  477M Linux filesystem
/dev/sda5  118163456 129882111 11718656  5.6G Linux filesystem
/dev/sda6  129882112 141600767 11718656  5.6G Linux filesystem


Disk /dev/sdg: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2CX1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sde: 12.75 TiB, 14000519643136 bytes, 27344764928 sectors
Disk model: ST14000NM001G-2K
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: A968E824-8EEC-4F6F-9297-E0AED5A66EEF

Device     Start   End Sectors Size Type
/dev/sde1     34 32767   32734  16M Microsoft reserved

Partition 1 does not start on physical sector boundary.


Disk /dev/sdf: 10.94 TiB, 12000138625024 bytes, 23437770752 sectors
Disk model: WDC WD120EMFZ-11
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: CDD1B551-4A3D-4FDE-BD6D-08CC02D6875C


Disk /dev/sdb: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2CX1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 296AB478-D5B3-4E6E-8EC6-1330DD7C6AD4


Disk /dev/sdc: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2CX1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 2E53662E-3F2E-43B0-A5CA-3DA685BAF97C

Device      Start         End     Sectors  Size Type
/dev/sdc2  264192 15628052479 15627788288  7.3T Microsoft basic data


Disk /dev/sdh: 12.75 TiB, 14000519643136 bytes, 27344764928 sectors
Disk model: ST14000NM001G-2K
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdd: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ST8000DM004-2CX1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 12103BA4-CED8-4E6B-9B9B-DE5F407F9B77

Device      Start         End     Sectors  Size Type
/dev/sdd1      34      262177      262144  128M Microsoft reserved
/dev/sdd2  264192 15628052479 15627788288  7.3T Microsoft basic data

Partition 1 does not start on physical sector boundary.


Disk /dev/sdi: 29.74 GiB, 31914983424 bytes, 62333952 sectors
Disk model: SD  Transcend   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7722bf23

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdi1  *     2048 62333951 62331904 29.7G  c W95 FAT32 (LBA)```

**Thank you!**
4
  • 1
    You can't mount or fsck a device like /dev/sdb. You must use partitions like /dev/sdb1. You can't fsck a partition if it's mounted. If you dual-boot with Windows, and you have a Windows driver installed that will let you read/write to linux ext/2/3/4 partitions, uninstall it asap, as it'll corrupt linux file systems all the time.
    – heynnema
    Sep 10, 2021 at 20:33
  • Thank you for commenting. "You can't mount or fsck a device like /dev/sdb. You must use partitions like /dev/sdb1." No this is not true, i can mount it after fsck.ext4 and there is no dev/sdb1 "You can't fsck a partition if it's mounted. " yes true i never did that "if you dual-boot with Windows, and you have a Windows driver installed that will let you read/write to linux ext/2/3/4 partitions, uninstall it asap, as it'll corrupt linux file systems all the time." Ok i am not using WSL anymore, only linux... still same problem
    – halpplz
    Sep 12, 2021 at 22:46
  • What version Ubuntu? If you look at most of the commands in your question, most fail, mostly with superblock issues... that's because you specified /dev/sdb.
    – heynnema
    Sep 12, 2021 at 23:04
  • Ubuntu 20.04.3 LTS
    – halpplz
    Sep 12, 2021 at 23:06

1 Answer 1

2

To properly fsck a file system, here's the correct way...

  • boot to a Ubuntu Live DVD/USB in “Try Ubuntu” mode
  • open a terminal window by pressing Ctrl+Alt+T
  • type sudo fdisk -l
  • identify the /dev/sdXX device name for your "Linux Filesystem"
  • type sudo fsck -f /dev/sdXX, replacing sdXX with the number you found earlier
  • repeat the fsck command if there were errors
  • type reboot

Update #1:

Backed up data. Reformatted the drive. Partitions are now present. It all works again.

8
  • I have 2 disks with this problem. After running fsck, one says "ext2fs_open2: Bad magic number in super-block fsck.ext2: Superblock invalid, trying backup blocks..."Other Disk sometimes says more after that "Superblock needs_recovery flag is clear, but journal has data. Recovery Flag not set in backup superblock, so running journal anyway." After that both awaits confirmation for alot of fixes. Second time fsck no errors. After reboot both disks same problem/errors as if fsck did nothing at all.
    – halpplz
    Sep 12, 2021 at 23:43
  • @halpplz Were you booted to a Ubuntu Live USB? Please tell me the EXACT fsck command that you used. Edit your question and show me sudo fdisk -l.
    – heynnema
    Sep 13, 2021 at 2:57
  • I i am on Ubuntu Live USB. I followed EXACTLY your instructions. I used "sudo fsck -f /dev/sdb". I updated question with sudo fdisk -l
    – halpplz
    Sep 13, 2021 at 10:16
  • @halpplz What a strange looking disk configuration. Were these disks init/format/built under WSL? I don't see partitions on most of them. I don't know WSL, so I can't explain why these disks look the way they do... but since you're apparently not using WSL any more... you may have to backup any data on sdb and reinit/reformat/rebuild sdb using standard Ubuntu procedures to get your problem fixed. Sorry I can't be of more help. Have you looked at the SMART data for sdb?
    – heynnema
    Sep 13, 2021 at 13:45
  • @halpplz Is halpplz a reference to the movie Fifth Element?
    – heynnema
    Sep 13, 2021 at 13:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.