0

I have a problem like this question How disk became suddenly write protected in spite configuration is read/write?

And I used these commands to resolve that umount /dev/sdb1 e2fsck /dev/sdb1 mount /dev/sdb1

but

~# e2fsck /dev/sdb1
e2fsck 1.44.5 (15-Dec-2018)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdb1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

/dev/sdb1 contains a ufs file system

additional commands to help you to know additional details

~#nano /etc/fstab
UUID=###951671### /DATA ufs defaults 1 2

mkdir /DATA

mount /DATA

~# ls -lat | grep DATA
drwxr-xr-x  5 root     root     1024 May 26 11:37 DATA

~# df -h | grep sd
/dev/sda1       276G  8.7G  254G   4% /
**/dev/sdb1       197G  102G   80G  57% /DATA**

~# lsblk -f | grep sd
sda                                                                                      
├─sda1 ext4                          ###-c0fb-42ce-9c78-###  253.2G     3% /
├─sda2                                                                                   
└─sda5 swap                          ###-27b4-485b-98b3-###                [SWAP]
sdb                                                                                      
└─sdb1 ufs                           ###951671###                       79.3G    52% /DATA

~:/DATA# ls
ls: reading directory '.': Input/output error


~:/DATA# mount -o rw,remount /dev/sdb1
mount: /DATA: mount point not mounted or bad option.

~# umount /DATA
~# e2fsck /DATA
e2fsck 1.44.5 (15-Dec-2018)
e2fsck: Is a directory while trying to open /DATA

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

~# mount /DATA
mount: /DATA: WARNING: device write-protected, mounted read-only.

At all, I would like to access to this hard /dev/sdb1 in /DATA folder

How can I resolve this problem?

2

Stop.

According to e2fsck, your /etc/fstab file, and your lsblk output, the filesystem type on /dev/sdb1 is ufs.

e2fsck is only for filesystem types ext2, ext3 and ext4. It cannot fix filesystem type ufs at all, and may in fact cause more damage to an UFS filesystem if you force it to attempt repairs anyway.

For checking and fixing an UFS filesystem, you would need fsck.ufs instead. On some Linux distributions, it is available as a package named ufsutils: use your package manager to install it.

Other than that, UFS is not a very often used filesystem in Linux - it is more of a Solaris or *BSD thing, I think. If this disk was moved from a Solaris or BSD system, you might take it back there and use the tools of the original system to check the filesystem - those tools are much more likely to be up to date with the filesystem version actually used.

| improve this answer | |
0

I resolved this problem

$ dmesg|grep bsd

[ 3.467958] sda1:

Then:

$ sudo mount -t ufs -r -o ufstype=ufs2 /dev/sdb1 ~/freebsd

Of course, for another version of linux line ubuntu we need to know: Possible common types are:

old old format of ufs
default value, supported as read-only
44bsd used in FreeBSD, NetBSD, OpenBSD
ufs2 used in FreeBSD 5.x
5xbsd synonym for ufs2
sun used in SunOS (Solaris)
sunx86 used in SunOS for Intel (Solarisx86)
hp used in HP-UX
nextstep used in NextStep
nextstep-cd used for NextStep CDROMs (block_size == 2048)
openstep used in OpenStep

and we have to use this command for ubuntu and like that

$ sudo mount -t ufs -r -o ufstype=44bsd /dev/sdb1 /DATA
| improve this answer | |
-1

You just need to uninstall or update ext2fsd in your Windows. However, in order to bring your Linux back temporarily or urgently, you may write the command below in the black screen you see the error:

e2fscl -c <-y> <device>

where you may write your Linux partition instead of <device>; for instance, /dev/sdb7. you either add -y or press y whenever the running asks you for it.

| improve this answer | |
  • As the original question and the answer posted by the OP indicates, the filesystem type was ufs. That filesystem type is not compatible with the e2fsck or any other tools designed for ext2/ext3/ext4 filesystems. – telcoM Apr 24 at 6:19

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.