Trouble formatting a USB SSD with failed Hassio install

Hi All, my Hassio (HASSOS?) install got corrupted. It was running on a Pi 3B+ and USB SSD.

I have since reinstalled it on another USB SSD and decided to prep the USB SSD with the failed installation of Hassio by burning the latest HassOS to it.

balenaEtcher failed to “burn” the new image on the USB so I tried to first format the USB SSD on my Mac. This also fails. (I have to “initialise…” the drive before it is seen by the Mac/balenaEtcher.)

What I can see happening is that the drive gets unmounted in the format process and then fails because the initialise message pops up again.

I can see all the volumes/partitions that is created on the USB SSD but cannot resize/delete any of them.

Finally I tried to format it from a Pi 3B running the latest raspberry os. This also fails but at least I got more info.

mke2fs 1.44.5 (15-Dec-2018)
/dev/sda1 contains a vfat file system labelled 'hassos-boot'
Proceed anyway? (y,N) y
Creating filesystem with 32768 1k blocks and 8192 inodes
Filesystem UUID: bla...bla
Superblock backups stored on blocks: 
	8193, 24577

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: mkfs.ext4: Input/output error while writing out and closing file system

Am I missing something?

It is a Sandisk extreme Pro which is not that old, so I don’t think the drive itself is faulty.

Any help would be appreciated.

Thanks
Paul

on a windows system, you clean and format the car using DISKPART. I can’t help with a Mac.

Unfortunately my work (windows) machine’s ports are blocked.

I have tried deleting the partitions with fdisk and creating a single partition on the raspberry pi. However this also fails…

The partition table has been altered.
/dev/sda: close device failed: Input/output error

The disc looks as follows.

/dev/sda1: SEC_TYPE="msdos" LABEL_FATBOOT="hassos-boot" LABEL="hassos-boot" UUID="5A51-5478" TYPE="vfat" PARTLABEL="hassos-boot" PARTUUID="b3dd0952-733c-4c88-8cba-cab9b8b4377f"
/dev/sda2: LABEL="hassos-kernel" UUID="085deec3-54c8-4ba8-af90-f99a72076758" TYPE="ext4" PARTLABEL="hassos-kernel0" PARTUUID="26700fc6-b0bc-4ccf-9837-ea1a4cba3e65"
/dev/sda3: TYPE="squashfs" PARTLABEL="hassos-system0" PARTUUID="8d3d53e3-6d49-4c38-8349-aff6859e82fd"
/dev/sda4: LABEL="hassos-kernel" UUID="dbb89191-177a-444f-8d2f-3cf63629862e" TYPE="ext4" PARTLABEL="hassos-kernel1" PARTUUID="fc02a4f0-5350-406f-93a2-56cbed636b5f"
/dev/sda5: TYPE="squashfs" PARTLABEL="hassos-system1" PARTUUID="a3ec664e-32ce-4665-95ea-7ae90ce9aa20"
/dev/sda7: LABEL="hassos-overlay" UUID="d7db0409-38d4-4794-bd98-636b03a59d40" TYPE="ext4" PARTLABEL="hassos-overlay" PARTUUID="f1326040-5236-40eb-b683-aaa100a9afcf"
/dev/sda8: LABEL="hassos-data" UUID="6cad13d7-d3f4-41ca-90a3-b4ab155d6ef5" TYPE="ext4" PARTLABEL="hassos-data" PARTUUID="a52a4597-fa3a-4851-aefd-2fbe9f849079"
/dev/mmcblk0: PTUUID="156df26c" PTTYPE="dos"
/dev/sda6: PARTLABEL="hassos-bootstate" PARTUUID="33236519-7f32-4dff-8002-3390b62c309d"

Instructions on how to clean the card on a MAC

Thanks again for the help! (Not sure why my searches did not find me this link…)

The USB SSD disc is still ignoring me…

PBMBP2015:Downloads paulburger$ sudo dd if=/dev/zero of=/dev/disk3 bs=1m count=1
1+0 records in
1+0 records out
1048576 bytes transferred in 2.421670 secs (432997 bytes/sec)

Afterwards (ejecting and then re-inserting + initialise to see it) it looks identical to before.

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *128.0 GB   disk3
   1:         Microsoft Reserved ⁨⁩                        33.6 MB    disk3s1
   2:           Linux Filesystem ⁨⁩                        25.2 MB    disk3s2
   3:           Linux Filesystem ⁨⁩                        268.4 MB   disk3s3
   4:           Linux Filesystem ⁨⁩                        25.2 MB    disk3s4
   5:           Linux Filesystem ⁨⁩                        268.4 MB   disk3s5
   6:           Linux Filesystem ⁨⁩                        8.4 MB     disk3s6
   7:           Linux Filesystem ⁨⁩                        100.7 MB   disk3s7
   8:           Linux Filesystem ⁨⁩                        127.3 GB   disk3s8

I’m now trying the recommendations on this page…

But I’m getting the impression that there is a readonly switch that I need to disable as this too does not seem to work…

pi@raspberrypi:~ $ sudo blkdiscard /dev/sda
blkdiscard: /dev/sda: BLKDISCARD ioctl failed: Operation not supported
pi@raspberrypi:~ $ 

wipefs just hangs after the first couple of byte written…

pi@raspberrypi:~ $ ls -la /dev/sd*
brw-rw---- 1 root disk 8, 0 Jan 31 05:18 /dev/sda
brw-rw---- 1 root disk 8, 1 Jan 31 05:18 /dev/sda1
brw-rw---- 1 root disk 8, 2 Jan 31 05:18 /dev/sda2
brw-rw---- 1 root disk 8, 3 Jan 31 05:18 /dev/sda3
brw-rw---- 1 root disk 8, 4 Jan 31 05:18 /dev/sda4
brw-rw---- 1 root disk 8, 5 Jan 31 05:18 /dev/sda5
brw-rw---- 1 root disk 8, 6 Jan 31 05:18 /dev/sda6
brw-rw---- 1 root disk 8, 7 Jan 31 05:18 /dev/sda7
brw-rw---- 1 root disk 8, 8 Jan 31 05:18 /dev/sda8
pi@raspberrypi:~ $ sudo wipefs -a -f /dev/sda
/dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 8 bytes were erased at offset 0x1dcffffe00 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa

Either that or maybe there is something missing from my pi that I first need to install before it can action the discard on the disc.

I have removed the current SSD (first one below) from HA and it looks identical to the one I’m trying to format (second one below).

I’m too scared to try and format the one that is working in case I “break” that one too and then I have no more HA (as it is just not worth using off an SD Card).

Command (m for help): p
Disk /dev/sda: 119.3 GiB, 128043712512 bytes, 250085376 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
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start   End Sectors    Size Id Type
/dev/sda1  *     2048 67583   65536     32M  c W95 FAT32 (LBA)
/dev/sda2           1  2047    2047 1023.5K ee GPT

Partition table entries are not in disk order.

Command (m for help): M
Leaving nested disklabel.

Command (m for help): p
Disk /dev/sda: 119.3 GiB, 128043712512 bytes, 250085376 sectors
Disk model: Extreme Pro     
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: gpt
Disk identifier: C63FDEBF-E0F2-4EE3-88F9-B7B862988B03

Device       Start       End   Sectors   Size Type
/dev/sda1     2048     67583     65536    32M Microsoft reserved
/dev/sda2    67584    116735     49152    24M Linux filesystem
/dev/sda3   116736    641023    524288   256M Linux filesystem
/dev/sda4   641024    690175     49152    24M Linux filesystem
/dev/sda5   690176   1214463    524288   256M Linux filesystem
/dev/sda6  1214464   1230847     16384     8M Linux filesystem
/dev/sda7  1230848   1427455    196608    96M Linux filesystem
/dev/sda8  1427456 250085342 248657887 118.6G Linux filesystem

Command (m for help): q

pi@raspberrypi:~ $ sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

A hybrid GPT was detected. You have to sync the hybrid MBR manually (expert command 'M').

Command (m for help): M

Entering protective/hybrid MBR disklabel.

Command (m for help): p
Disk /dev/sda: 119.3 GiB, 128043712512 bytes, 250085376 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
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start   End Sectors    Size Id Type
/dev/sda1  *     2048 67583   65536     32M  c W95 FAT32 (LBA)
/dev/sda2           1  2047    2047 1023.5K ee GPT

Partition table entries are not in disk order.

Command (m for help): M
Leaving nested disklabel.

Command (m for help): p
Disk /dev/sda: 119.3 GiB, 128043712512 bytes, 250085376 sectors
Disk model: Extreme Pro     
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: gpt
Disk identifier: 631DE6C9-97D2-45FF-9279-F20BFCB7AB4A

Device       Start       End   Sectors   Size Type
/dev/sda1     2048     67583     65536    32M Microsoft reserved
/dev/sda2    67584    116735     49152    24M Linux filesystem
/dev/sda3   116736    641023    524288   256M Linux filesystem
/dev/sda4   641024    690175     49152    24M Linux filesystem
/dev/sda5   690176   1214463    524288   256M Linux filesystem
/dev/sda6  1214464   1230847     16384     8M Linux filesystem
/dev/sda7  1230848   1427455    196608    96M Linux filesystem
/dev/sda8  1427456 250085342 248657887 118.6G Linux filesystem

I’m assuming the fact that the file write of the wipe command did not succeed as the one for PMBR only displays two hex(?) values.


Disk /dev/sda: 119.3 GiB, 128043712512 bytes, 250085376 sectors
Disk model: Extreme Pro     
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: gpt
Disk identifier: 631DE6C9-97D2-45FF-9279-F20BFCB7AB4A

Device       Start       End   Sectors   Size Type
/dev/sda1     2048     67583     65536    32M Microsoft reserved
/dev/sda2    67584    116735     49152    24M Linux filesystem
/dev/sda3   116736    641023    524288   256M Linux filesystem
/dev/sda4   641024    690175     49152    24M Linux filesystem
/dev/sda5   690176   1214463    524288   256M Linux filesystem
/dev/sda6  1214464   1230847     16384     8M Linux filesystem
/dev/sda7  1230848   1427455    196608    96M Linux filesystem
/dev/sda8  1427456 250085342 248657887 118.6G Linux filesystem
pi@raspberrypi:~ $ sudo wipefs -a -f /dev/sda
/dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 8 bytes were erased at offset 0x1dcffffe00 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
pi@raspberrypi:~ $ sudo fdisk -l
.
.
.

Disk /dev/sda: 119.3 GiB, 128043712512 bytes, 250085376 sectors
Disk model: Extreme Pro     
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: gpt
Disk identifier: 631DE6C9-97D2-45FF-9279-F20BFCB7AB4A

Device       Start       End   Sectors   Size Type
/dev/sda1     2048     67583     65536    32M Microsoft reserved
/dev/sda2    67584    116735     49152    24M Linux filesystem
/dev/sda3   116736    641023    524288   256M Linux filesystem
/dev/sda4   641024    690175     49152    24M Linux filesystem
/dev/sda5   690176   1214463    524288   256M Linux filesystem
/dev/sda6  1214464   1230847     16384     8M Linux filesystem
/dev/sda7  1230848   1427455    196608    96M Linux filesystem
/dev/sda8  1427456 250085342 248657887 118.6G Linux filesystem

Anyway, it seems I need to go and buy another SDD but also do not really want to go down this route if it will simply happen again when the pi 4b+ comes out.

I know Diskpart works…do you have a friend with a windows computer? It is possible that the ssd has failed, but most likely it’s a problem with the partition table or something on the drive itself which can be repaired with diskpart or equivalent…

Hi Douglas, this is what diskpart gives me.

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online           64 GB      0 B
  Disk 1    Online          119 GB   119 GB

DISKPART> select disk 1

Disk 1 is now the selected disk.

DISKPART> clean

DiskPart has encountered an error: Data error (cyclic redundancy check).
See the System Event Log for more information.

DISKPART>

I found these steps and will be trying those this evening.

I finally got to try AOMEI partition assistant and from what I can see is that there are 4 bad sectors on the usb stick.

The problem now is that AOMEI uses chkdsk to mark the bad sectors, but because I have wiped the disc the it can not be mounted, which means the t option is greyed out. I first need to create a partition, however the bad sectors is preventing AOMEI from creating the partitions.

I’m sure it must be possible to recover/reformat the disc, but I’m giving up and will wait for the Argon M.2 case which should hopefully be stable in the long run.

Just to close off my saga…

I returned the unit to the supplier and they refunded me.

We’ll thats nice, but i happen to have the issue. And your suggestion does not work.

Diskpart does not work in this case.