Announcement

Collapse
No announcement yet.

deleting read-only USB partition

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    deleting read-only USB partition

    I made a backup using Kup on a USB drive (so I can update to 26.04).

    Now I can't access that USB nor write a new backup to it. I can't mount it, remount it or delete it via GParted or Partition Manager.

    It seems like it's never been mounted...

    donald@donald:~$ sudo mkfs.ext4 /dev/sda1 #For ext4
    mke2fs 1.47.0 (5-Feb-2023)
    /dev/sda1 contains a ext4 file system
    last mounted on /media/donald/0dbeacc9-c3d7-4d6a-912a-d5283bd3da78 on Mon Dec 1 13:30:24 2025
    Proceed anyway? (y,N) y
    /dev/sda1: Read-only file system while setting up superblock


    donald@donald:~$ sudo fdisk -l

    Device BootStart End Sectors SizeIdType
    /dev/sda1 18944 484362239 484343296 231G 83 Linux


    Last edited by papapenguin; Yesterday, 02:23 PM.

    #2
    Originally posted by papapenguin View Post
    Now I can't access that USB nor write a new backup to it.
    Even with Kup?
    Windows no longer obstruct my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      I can view the backup in Kup, but can't do anything with it -- including add a new backup plan.

      I just now deleted the 'backup plan 1', tried to create another backup, and now it doesn't display the USB at all under Disks and Devices.

      donald@donald:~$ lsusb
      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
      Bus 001 Device 003: ID 0b05:19b6 ASUSTek Computer, Inc. N-KEY Device
      Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
      Bus 002 Device 006: ID 154b:1006 PNY USB 3.2.1 FD
      Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
      Bus 003 Device 002: ID 27c6:521d Shenzhen Goodix Technology Co.,Ltd. FingerPrint
      Bus 003 Device 003: ID 13d3:3563 IMC Networks Wireless_Device
      Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub


      and

      donald@donald:~$ sudo fdisk /dev/sda1
      [sudo] password for donald:

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

      fdisk: cannot open /dev/sda1: Read-only file system

      at command line

      Comment


        #4
        gparted displays /dev/sda and /dev/sda1, but when trying to access, delete or change either one, it hangs at 'pending'. I just tried 'attempt Data rescue' at /dev/sda1 and get 'The disk scan by gpart did not find any recognizable file systems on this disk.

        Comment


          #5
          I would also try the following:

          What is you output of
          cat /etc/fstab
          (in case your USB drive is listed there…)
          and when the USB drive is connected, what is your output of
          lsblk -f -e7
          ?

          PS: One possibility always can be that an USB drive is simply broken - did you try with another one?
          Last edited by Schwarzer Kater; Yesterday, 04:00 PM. Reason: added PS
          Debian LXQt • Kubuntu • openSUSE KDE • Linux Mint • Windows • macOS
          Desktop: HP Elite SFF 805 G9 • Laptop: Apple MacBook Pro 13" • and others

          important things to do after installation (24/26.04)get rid of Snap script (20.04 +)
          install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04 +)

          Comment


            #6
            firstly, I found a test for bad blocks which yielded:
            donald@donald:~$ sudo badblocks -v /dev/sda
            [sudo] password for donald:
            Checking blocks 0 to 242181119
            Checking for bad blocks (read-only test): done
            Pass completed, 0 bad blocks found. (0/0/0 errors)


            donald@donald:~$ cat /etc/fstab
            # /etc/fstab: static file system information.
            #
            # Use 'blkid' to print the universally unique identifier for a device; this may
            # be used with UUID= as a more robust way to name devices that works even if
            # disks are added and removed. See fstab(5).
            #
            # <file system> <mount point> <type> <options> <dump> <pass>
            UUID=E53E-8536 /boot/efi vfat defaults 0 2
            UUID=8931e8a9-bc1a-420f-8639-c800abf1403c / ext4 defaults 0 1
            /swapfile swap swap defaults 0 0
            tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0


            donald@donald:~$ lsblk -f -e7
            NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
            sda
            └─sda1 ext4 1.0 0dbeacc9-c3d7-4d6a-912a-d5283bd3da78
            nvme0n1
            ├─nvme0n1p1 vfat FAT32 E53E-8536 293.3M 2% /boot/efi
            └─nvme0n1p2 ext4 1.0 kubuntu_2404 8931e8a9-bc1a-420f-8639-c800abf1403c 139.2G 65% /var/snap/firefox/common/host-hunspell
            /


            Comment


              #7
              /etc/fstab is not the culprit in your case
              and the output of lsblk -f -e7 looks like it should be before mounting the USB drive…

              Sorry, have to go - other half is calling from the bedroom…
              Debian LXQt • Kubuntu • openSUSE KDE • Linux Mint • Windows • macOS
              Desktop: HP Elite SFF 805 G9 • Laptop: Apple MacBook Pro 13" • and others

              important things to do after installation (24/26.04)get rid of Snap script (20.04 +)
              install traditional Firefox script (22.04 +)​ • install traditional Thunderbird script (24.04 +)

              Comment


                #8
                when opening Dolphin and trying to access the drive, I get this error:
                An error occurred while accessing '231.0 GiB Removable Media', the system responded: The requested operation has failed: Error mounting /dev/sda1 at /media/donald/0dbeacc9-c3d7-4d6a-912a-d5283bd3da78: cannot mount /dev/sda1 read-only

                Comment


                  #9
                  AI Overview

                  To make a read-only USB drive writable in Linux, first try remounting it with write permissions using sudo mount -o remount,rw /dev/sdX1 or checking the filesystem with fsck. If those fail, clear the read-only attribute using sudo hdparm -r0 /dev/sdX. If the issue persists, the drive may have a physical switch or require formatting.



















                  Windows no longer obstruct my view.
                  Using Kubuntu Linux since March 23, 2007.
                  "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                  Comment


                    #10
                    yeah, I saw that article and tried both. I'm not sure why nothing seems to work, especially after testing for bad blocks. I bought the USB new and immediately created the first backup -- I guess there's a chance it corrupted the drive.

                    donald@donald:~$ sudo hdparm -r0 /dev/sda

                    /dev/sda:
                    setting readonly to 0 (off)
                    readonly = 1 (on)
                    donald@donald:~$ sudo hdparm -r0 /dev/sda1

                    /dev/sda1:
                    setting readonly to 0 (off)
                    readonly = 1 (on)
                    donald@donald:~$ sudo hdparm -r0 /dev/sda1

                    /dev/sda1:
                    setting readonly to 0 (off)
                    readonly = 1 (on)

                    Comment


                      #11
                      If this was windows I'd try fix it with diskpart to rewrite the GPT.
                      I don't know how to do that in linux.

                      Comment


                        #12
                        the last bit of sudo dmesg when I tried to mount the USB:

                        [ 1809.767991] /dev/sda1: Can't open blockdev
                        [ 1809.778039] EXT4-fs (sda1): INFO: recovery required on readonly filesystem
                        [ 1809.778043] EXT4-fs (sda1): write access unavailable, cannot proceed (try mounting with noload)


                        Comment


                          #13
                          The partiton table is probably borked.

                          You can zap the first few mb using dd, or if the drive is using GPT instead of mbr (quite likley) you can use sgdisk to zap the gpt info. Also, mkusb's GUI may have such an option, but I have not used this is some time.

                          Make sure the USB is not mounted, and verify the device name, then:
                          Code:
                          sudo dd if=/dev/zero bs=1M count=10 of=/dev/sdX
                          Try and repartition. Use KDE Partiton Manager if you want here.

                          If it is not working, try sgdisk (you probably need to install gdisk to get it)

                          Code:
                          sudo sgdisk --zap-all /dev/sdX
                          Self-built: Asus PRIME B550M-K/Ryzen 5600GT/32Gb/Intel ARC B580 12Gb/KDE neon
                          HP Elitedesk 800 G3 Mini: i5-7500T(35w)/32Gb/Kubuntu LTS
                          HP Chromebook 14: i5-1135G7/8Gb/512Gb SSD/KDE Linux

                          Comment

                          Users Viewing This Topic

                          Collapse

                          There are 0 users viewing this topic.

                          Working...
                          X