Hello everyone, I’m trying to format a USB flash disk by Manjaro Linux, but I’m not succeeding. All attempts return error and some with message: failed to open ‘/dev/sdb1’: Read-only file system.
I’m trying to format because I want to create a boot image of Manjaro KDE (I’m currently using GNOME)
lsblk -a
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdb 8:16 1 7,5G 1 disk
└─sdb1 8:17 1 7,5G 1 part
ls -l /dev/sdb
brw-rw---- 1 root disk 8, 16 jun 21 19:41 /dev/sdb
Some attempts
sudo sgdisk --zap-all /dev/sdb
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
Warning! Secondary partition table overlaps the last partition by
33 blocks!
You will need to delete this partition or resize it in another utility.
Problem opening '/dev/sdb' for writing! Program will now terminate.
Warning! MBR not overwritten! Error is 30!
this return ok
sudo chown -R $USER /dev/sdb
but…
rm -rf test_write1.dvr
rm: unable to remove 'test_write1.dvr': Read-only file system
sudo rm -rf test_write1.dvr
rm: unable to remove 'test_write1.dvr': Read-only file system
I recognize that from when playing around with raspberry pi os, they have a boot partition (MBR) and somehow also a boot the first sectors in the / partition that is in GPT. I recall reading something about GPT needing 33 blocks a 512kb for the filesystem or somtething.
Try removing all partitions and recreate a clean new GPT with f ex fdisk or parted, or just do it in gparted in gui.
Might be a wild hunch, but that 33 blocks hit a memory spot.
When changing permissions or doing things your user does not have rights for … you will need to use something like sudo.
But … regardless of all that … lets help you clean/format the device …
Maybe fdisk would be friendly to use;
First make sure the thing is unmounted:
sudo umount /dev/sdb1
Then you can start fdisk in interactive mode
sudo fdisk /dev/sdb
From there you can hit d for delete and select the partition.
Then hit g to create a new GPT partition table or o for MBR table - as yours seems broken.
Then hit n to create a new partition.
To write/exit hit w.
sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.38.1).
Changes will only remain in memory until you decide to save them.
Be careful before using the write command.
fdisk: could not open /dev/sdb: Read-only file system
That might be a sign of faulty hardware tbh.
Doesn’t linux automatically put anything in read only mode if it detects hardware irregularities?
Edit. I cross my fingers I am wrong.
(then try mounting or interacting with it again - fdisk, i suppose)
Also please verify your device does not have some sort of hard switch - for example many SD cards may have a little toggle for ‘locking’ which can force this read-only situation.
Right, alternative B would not be possible, because I don’t have a physical switch on this device.
But, considering alternative A, how do you know if it really has reached the end of its useful life?
Look, every Flash Drive has a Controller and a Flash Memory. The controller controls how much data can be written and how in simple words. There is a hard limit of write cycles, like on any SSD. On dump USB Flash Drives, you can only detect it when you cannot write data on it (create, modify, delete), but still you can read everything.
@megavolt Wow, I’m def bookmarking that for playing around with, I have played around with mounting isos directly in my standard grub, this is a very nice reference! Thank you!
To use nvidia do I only have to change set dri="free" to nonfree, or does this still bring up the grub menu (I see a timeout) and this is just the menu chooser will be at default?