#Cant write to sdb1

1 messages · Page 1 of 1 (latest)

cunning crag
#

i mounted sdb1 to /mnt/data then i created a folder, after some time i tried to create a new folder but it just said mkdir: cannot create directory ‘folder’: Input/output error it seems i cant delete things either also i still can read from the disk, i have not updated anything in between the folder creationings

fervent pivot
#

Is sdb1 still mounted there

cunning crag
cunning crag
fervent pivot
#

Sounds like a hw issue

#

is it usb?

cunning crag
#

no

#

its in the pc

fervent pivot
#

sudo dmesg | grep sdb

cunning crag
fervent pivot
#
[163492.315386] Buffer I/O error on dev sdb1, logical block 0, lost sync page write
[163492.315394] EXT4-fs (sdb1): I/O error while writing superblock
[163492.315396] EXT4-fs (sdb1): Remounting filesystem read-only
#

remounting as read only is the cause of the failure to write

#

sudo smartctl -a /dev/sdb

cunning crag
fervent pivot
#

sudo smartctl -i /dev/sdb

cunning crag
# fervent pivot `sudo smartctl -i /dev/sdb`
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.13.2-arch1-1] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sdb failed: INQUIRY failed```
fervent pivot
#

hmm

#

unmount sdb1 and try again

#

copy your files out of there if they're important

cunning crag
#

sorry for waiting, my internet broke

cunning crag
fervent pivot
#

lsof | grep data

cunning crag
fervent pivot
#

lsof | grep mnt/data

cunning crag
#

i started a server while being there

#

adb server

fervent pivot
#

quit it

#

or kill

cunning crag
#

did but the issue is still there

fervent pivot
#

the umount

cunning crag
#

oh

#

ok

#

now mount it back?

fervent pivot
#

smartctl

cunning crag
fervent pivot
#

sudo smartctl /dev/sdb

cunning crag
fervent pivot
#

sudo smartctl /dev/sda

cunning crag
fervent pivot
#

Is it a new or old drive

#

Could be failing or a bad connection

cunning crag
#

idk but the computer wasnt moving or shaked before the issue appearing

#

the fact that i made a folder successfully and then just a few minutes later this issue appears that i cant write to the disk anymore

fervent pivot
#

Reboot and try smartctl -a again

#

Sometimes disks just fail seemingly randomly

cunning crag
#

i will try that

fervent pivot
#

/dev/sdb

#

it's no longer in lsblk

#

looks like it just completely failed (or detached) :/

#

look at the dmesg

#

You should be able to find something there related to it

#

try the grep sdb

#

Kernel might not be able to identify that it's sdb anymore though

cunning crag
#

nothing. sdb is gone

fervent pivot
#

grep for scsi

cunning crag
#

wait what

#

i have been using an SSD this whole time while thinking it was a hard drive

#

but

#

i have heard hdd sounds from my pc

#

what

fervent pivot
#

from the sdb or did you just attach it?

cunning crag
#

The 128GB ssd is the sda btw

cunning crag
fervent pivot
#

the hdd that just failed

#

or sdd I dunno what it is

cunning crag
#

well i know that the sdb is a hdd

fervent pivot
#

If it was still visible to the os it would show up in the same style as the Azerty ssd

#

Replug the hdd

cunning crag
fervent pivot
#

Maybe worth trying to scan the sata port

#

echo "0 0 0" >/sys/class/scsi_host/host<n>/scan

#

host<number> are different sata ports

#

I don't know how to tell which one of them is your ssd and which one is the hdd

#

@cunning crag

cunning crag
fervent pivot
#

ls /sys/class/scsi_host and replace <n>

cunning crag
fervent pivot
#

the echo command has to be run as the root user

#

su -

cunning crag
#

ok

fervent pivot
#

sudo won't work as root privs won't carry over to the >

#

which appends to a file

#

it's done by the shell

cunning crag
#

with what do i replace <n>

fervent pivot
#

in a another terminal sudo dmesg -w and keep it open

#

then go through the numbers until there's something related to sdb or the hdd

cunning crag
#

Host0: [ 1928.341035] ata1.01: failed to resume link (SControl 0) [ 1928.493071] ata1.00: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 1928.493093] ata1.01: SATA link down (SStatus 0 SControl 0) [ 1928.495075] ata1.00: configured for UDMA/133
Host1:[ 1968.931833] ata2.01: failed to resume link (SControl 0) [ 1968.942775] ata2.00: SATA link down (SStatus 0 SControl 300) [ 1968.942789] ata2.01: SATA link down (SStatus 0 SControl 0)
Host2:[ 2007.851725] ata3: link is slow to respond, please be patient (ready=0) [ 2012.443607] ata3: SRST failed (errno=-16) [ 2017.908449] ata3: link is slow to respond, please be patient (ready=0) [ 2022.454317] ata3: SRST failed (errno=-16) [ 2027.916161] ata3: link is slow to respond, please be patient (ready=0) [ 2057.469304] ata3: SRST failed (errno=-16) [ 2057.469315] ata3: limiting SATA link speed to 1.5 Gbps [ 2062.473158] ata3: SRST failed (errno=-16) [ 2062.484155] ata3: softreset failed [ 2062.484159] ata3: reset failed, giving up
Host3:[ 2089.440977] ata4: SATA link down (SStatus 0 SControl 300)

fervent pivot
#

journalctl -b-1 | grep scsi

#

-b-1 is the previous boots logs

#

-b0 is current boots

cunning crag
fervent pivot
#

How about -b-2

cunning crag
#

interesting things i have found about my hdd

fervent pivot
#

Maybe your bios has sata controller mode in something other than AHCI

#

of what to look for

cunning crag
fervent pivot
cunning crag
#

so, what is there something i need to do? or not yet

fervent pivot
#

Check what its set to

#

and try ahci if it's not set to that

cunning crag
cunning crag
cunning crag
fervent pivot
#

Were you able to boot linux?

cunning crag
#

yes

fervent pivot
#

What was it before

#

IDE?

cunning crag
fervent pivot
#

Phone 😛

cunning crag
fervent pivot
#

Leave it as ahci as it's better

#

The drive is likely dead if replugging it does not work tomorrow :(

cunning crag
# fervent pivot Phone 😛

idk, it doesnt work it looks like the government did a good job at blocking vpns but not as good of a job at blocking tor browser