Page 1 of 1

FSCK issue (Won't let me proceed on unmounted partition)

Posted: 2020/04/18 08:22:17
by fountain-radar

A partition /dev/sdb in my web server has failed FSCK check but I can't seem to figure out a way to repair it.

In /etc/fstab, I have commented out this partition.

I used the command umount /dev/sdb and it returned saying it is not mounted.

Also, I tried

Code: Select all

root@server3 [~]# fsck -A /dev/sdb
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/sda5 is mounted.
e2fsck: Cannot continue, aborting.

File system is currently set as:

Code: Select all

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5       221G  156G   55G  75% /
tmpfs            16G     0   16G   0% /dev/shm
/dev/sda1       504M   66M  413M  14% /boot
/dev/sda3       4.0G  139M  3.7G   4% /tmp
/dev/sdb2       219G   66G  142G  32% /wjgbk
FSTAB file looks like this:

Code: Select all

# /etc/fstab
# Created by anaconda on Fri Oct 11 07:42:05 2013
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
UUID=8fec8cf7-4999-489c-a344-8b16ab7402e2       /       ext4    usrjquota=quota.user,jqfmt=vfsv0        1       1
UUID=7f2583f8-7d07-43a9-9f81-0f24a449e97a /boot                   ext4    defaults        1 2
#UUID=793f6375-bd81-4392-9cf7-adff4149b72c      /home2  ext4    usrjquota=quota.user,jqfmt=vfsv0        1       2
UUID=2e71e9e4-a05a-4282-9e48-a82a364ef3e8 /tmp                    ext4    defaults        1 2
UUID=7e4202fe-c53a-4475-bfb8-66271e08137f       /wjgbk  ext4    defaults        1       2
UUID=67f4cccf-fca2-46b8-8f4c-53af3512b7af swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/tmp             /var/tmp                    ext3    defaults,bind,noauto        0 0

And the UID's refer to the following:

Code: Select all

root@server3 [/dev]# blkid
/dev/sdb1: UUID="793f6375-bd81-4392-9cf7-adff4149b72c" TYPE="ext4"
/dev/sdb2: UUID="7e4202fe-c53a-4475-bfb8-66271e08137f" TYPE="ext4"
/dev/sda1: UUID="7f2583f8-7d07-43a9-9f81-0f24a449e97a" TYPE="ext4"
/dev/sda2: UUID="67f4cccf-fca2-46b8-8f4c-53af3512b7af" TYPE="swap"
/dev/sda3: UUID="2e71e9e4-a05a-4282-9e48-a82a364ef3e8" TYPE="ext4"
/dev/sda5: UUID="8fec8cf7-4999-489c-a344-8b16ab7402e2" TYPE="ext4"
Any ideas on how to proceed with the FSCK check? I need to recover the data from this partition and move it all to a new server asap.

Re: FSCK issue (Won't let me proceed on unmounted partition)

Posted: 2020/04/18 11:59:33
by TrevorH
fsck -A doesn't mean what you think it means. From the man page:
-A Walk through the /etc/fstab file and try to check all filesystems in one run.
Which is why you tell it to check /dev/sdb and it complains about /dev/sda5.

Also, since your df output clearly shows that /dev/sdb is partitioned and /dev/sdb2 has a filesystem on it, you will not be able to fsck /dev/sdb at all since it has a partition table and /dev/sdb is the entire device, not a single partition on it.

I am presuming that since you have commented the filesystem whose UUID starts 793 from fstab, that that is the one that you want to fsck. Your lsblk shows that that is /dev/sdb1 so your correct command would be fsck -f /dev/sdb1