Leaskovski
Posts: 13
Joined: Tue May 12, 2015 9:29 am

Problem Disk with ext4 (was NTFS)

Fri Jan 11, 2019 5:25 pm

So my external disk that is connected to the PI and to a USB power source is not playing ball whilst I zap it and set it up to use ext4.

Previously I had been using the disk with NTFS and I decided to blat the whole disk and start again to get better performance from it. I have a backup of its contents on another disk.

So, I have done the following to clean the disk and start again:

Code: Select all

sudo dd if=/dev/zero of=/dev/sda  bs=512  count=1
sudo fdisk /dev/sda
I then use fdisk to create a primary partition, ignore any existing journal and go with the defaults it offers me. Then I format and mount it:

Code: Select all

sudo mkfs.ext4 /dev/sda1
sudo mount /dev/sda1 /media/USBHDD1
At this point, I wait a minute or two, and then DMESG to see how we are doing with the disk:

Code: Select all

[20830.336429]  sda: sda1
[20844.622851]  sda: sda1
[20927.499970] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20927.499987] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20927.499999] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20927.500014] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 00 00 08 00 00 00 08 00
[20927.500025] print_req_error: critical target error, dev sda, sector 2048
[20927.500035] Buffer I/O error on dev sda1, logical block 0, lost sync page write
[20927.597840] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[20936.181643] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20936.181662] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20936.181674] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20936.181689] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 1d 04 08 18 00 00 08 00
[20936.181702] print_req_error: critical target error, dev sda, sector 486803480
[20936.181720] print_req_error: critical target error, dev sda, sector 486803480
[20936.181767] Aborting journal on device sda1-8.
[20936.182428] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20936.182440] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20936.182451] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20936.182463] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 1d 04 08 00 00 00 08 00
[20936.182472] print_req_error: critical target error, dev sda, sector 486803456
[20936.182482] Buffer I/O error on dev sda1, logical block 60850176, lost sync page write
[20936.192360] JBD2: Error -5 detected when updating journal superblock for sda1-8.
[20937.323544] EXT4-fs (sda1): previous I/O error to superblock detected
[20937.324324] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20937.324339] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20937.324351] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20937.324365] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 00 00 08 00 00 00 08 00
[20937.324375] print_req_error: critical target error, dev sda, sector 2048
[20937.324387] Buffer I/O error on dev sda1, logical block 0, lost sync page write
[20937.324443] EXT4-fs error (device sda1): ext4_journal_check_start:61: Detected aborted journal
[20937.329586] EXT4-fs (sda1): Remounting filesystem read-only
[20937.332261] EXT4-fs (sda1): previous I/O error to superblock detected
[20937.332866] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20937.332878] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20937.332889] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20937.332901] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 00 00 08 00 00 00 08 00
[20937.332910] print_req_error: critical target error, dev sda, sector 2048
[20937.332919] Buffer I/O error on dev sda1, logical block 0, lost sync page write
As you can see, it barks and swaps to read only. I don't think I ever saw errors like this when it was an NTFS partition and was mounting fine and writeable.

Is the disk really that borked? I have had data on it for ages without corruption of loss.

What is the write way to fully zap a disk and start again with it?

fruitoftheloom
Posts: 19799
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Problem Disk with ext4 (was NTFS)

Fri Jan 11, 2019 6:00 pm

Leaskovski wrote:
Fri Jan 11, 2019 5:25 pm
So my external disk that is connected to the PI and to a USB power source is not playing ball whilst I zap it and set it up to use ext4.

Previously I had been using the disk with NTFS and I decided to blat the whole disk and start again to get better performance from it. I have a backup of its contents on another disk.

So, I have done the following to clean the disk and start again:

Code: Select all

sudo dd if=/dev/zero of=/dev/sda  bs=512  count=1
sudo fdisk /dev/sda
I then use fdisk to create a primary partition, ignore any existing journal and go with the defaults it offers me. Then I format and mount it:

Code: Select all

sudo mkfs.ext4 /dev/sda1
sudo mount /dev/sda1 /media/USBHDD1
At this point, I wait a minute or two, and then DMESG to see how we are doing with the disk:

Code: Select all

[20830.336429]  sda: sda1
[20844.622851]  sda: sda1
[20927.499970] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20927.499987] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20927.499999] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20927.500014] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 00 00 08 00 00 00 08 00
[20927.500025] print_req_error: critical target error, dev sda, sector 2048
[20927.500035] Buffer I/O error on dev sda1, logical block 0, lost sync page write
[20927.597840] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[20936.181643] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20936.181662] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20936.181674] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20936.181689] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 1d 04 08 18 00 00 08 00
[20936.181702] print_req_error: critical target error, dev sda, sector 486803480
[20936.181720] print_req_error: critical target error, dev sda, sector 486803480
[20936.181767] Aborting journal on device sda1-8.
[20936.182428] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20936.182440] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20936.182451] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20936.182463] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 1d 04 08 00 00 00 08 00
[20936.182472] print_req_error: critical target error, dev sda, sector 486803456
[20936.182482] Buffer I/O error on dev sda1, logical block 60850176, lost sync page write
[20936.192360] JBD2: Error -5 detected when updating journal superblock for sda1-8.
[20937.323544] EXT4-fs (sda1): previous I/O error to superblock detected
[20937.324324] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20937.324339] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20937.324351] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20937.324365] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 00 00 08 00 00 00 08 00
[20937.324375] print_req_error: critical target error, dev sda, sector 2048
[20937.324387] Buffer I/O error on dev sda1, logical block 0, lost sync page write
[20937.324443] EXT4-fs error (device sda1): ext4_journal_check_start:61: Detected aborted journal
[20937.329586] EXT4-fs (sda1): Remounting filesystem read-only
[20937.332261] EXT4-fs (sda1): previous I/O error to superblock detected
[20937.332866] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08
[20937.332878] sd 0:0:0:0: [sda] tag#0 Sense Key : 0x5 [current]
[20937.332889] sd 0:0:0:0: [sda] tag#0 ASC=0x24 ASCQ=0x0
[20937.332901] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 08 00 00 08 00 00 00 08 00
[20937.332910] print_req_error: critical target error, dev sda, sector 2048
[20937.332919] Buffer I/O error on dev sda1, logical block 0, lost sync page write
As you can see, it barks and swaps to read only. I don't think I ever saw errors like this when it was an NTFS partition and was mounting fine and writeable.

Is the disk really that borked? I have had data on it for ages without corruption of loss.

What is the write way to fully zap a disk and start again with it?

Linux gparted, it is in most Linux repositories:

https://gparted.org
adieu

My other Computer is an Asus CS10 ChromeBit running Chrome Operating System.
HP Envy 4500 Wireless Printer supported by HPLIP software in Raspbian Buster.
Raspberry Pi Model 2B v1.1

User avatar
thagrol
Posts: 1616
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Problem Disk with ext4 (was NTFS)

Fri Jan 11, 2019 7:09 pm

Further to that, for gparted to modify the disc it must not be mounted. I'd advise deleting any existing partitions and applying changes then creating new ones rather than reformating the existing one.
This space unintentionally left blank.

Leaskovski
Posts: 13
Joined: Tue May 12, 2015 9:29 am

Re: Problem Disk with ext4 (was NTFS)

Sat Jan 12, 2019 12:27 pm

Ok, I shall try gparted for it then. I used mini partition tool on my windows 10 machine to perform a surface scan and it came back clean.

Maybe that will sort it?

The only other thing I think I might have to do, is get a proper usb hub.

swampdog
Posts: 197
Joined: Fri Dec 04, 2015 11:22 am

Re: Problem Disk with ext4 (was NTFS)

Mon Jan 14, 2019 6:24 pm

Just on the offchance..

I plugged a cheap usb sata caddy into an rpi3 over xmas and noticed it will power down and vanish off the usb unless it's mounted reasonably quick - couple of minutes. "lsusb" / "lsscsi" for that and "tail -f /var/log/messages".

Alphag
Posts: 8
Joined: Sat Nov 17, 2018 5:21 pm

Re: Problem Disk with ext4 (was NTFS)

Mon Jan 14, 2019 6:50 pm

I think you have to set write permissions to the ext4 disk. You can do this with the following command:

Code: Select all

sudo chmod -R 777 "disk_path"

Return to “Raspbian”