Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
See picture for probable cause. I can format a USB to ext4, take ownership, but always read only seemingly even to root. I previously used this USB as NTFS and it worked. What can I do? I can repair it then take ownership again. Never can check file system of it. Is there anything I can do? I am on an Ubuntu desktop 22.04.3 LTS with Ubuntu Pro on a Lenovo Thinkpad T460. I have also tried "sudo chmod 777 (USB path)" and "sudo chown norvel (USB path)". norvel is like my user and like only user on this PC. I do not have any data on that USB to lose. It is a 2.1TB USB. X E.
Most likely it has bad sectors, and unfortunately at least one of those bad sectors is located where ext4 puts its journal superblock. I don't know where this would be, but likely the innermost blocks (lowest numbers) for performance reasons (only applicable to spinning hard drives, but those are still heavily used).
NTFS likes to start placing its stuff in the middle, and work its way outward in both directions. So it's possible it simply doesn't hit the bad blocks.
To test this theory, try creating an ext4 partition that does NOT use up all the space. Instead, just try and create a small ext4 partition near the middle, leaving unused spaces to the left and right.
If the theory is correct, then this will have no problem doing a file check and read/write just fine.
What can you do about it? You can try to create an ext4 partition that leaves some small amount of empty space to the left, and see how that goes. I would be wary about trusting the drive, though.
An additional thing I found, before I own it I can check file system and it always says needs repair even after I just repaired it. If it is like be wary of use then maybe why bother but still may as well test. So just to be clear, how do I make it "in middle", could I just half it and try a half? I do not know how to place a partition at a spot like that. X E.
Should I try long way or erase all on that USB? Maybe just try what you said first. This USB has written before. Also, is it safe for like my computer to do this test? If not then maybe I just get a new USB. X E.
An additional thing I found, before I own it I can check file system and it always says needs repair even after I just repaired it. If it is like be wary of use then maybe why bother but still may as well test. So just to be clear, how do I make it "in middle", could I just half it and try a half? I do not know how to place a partition at a spot like that. X E.
How are you creating the partitions?
An easy GUI option is GParted. The basic steps you'll want to do are:
1) Right click on the existing partitions; delete it.
2) Commit changes. (OBVIOUSLY make sure you're doing this on the correct drive.)
3) Right click on the empty space; new partition. Drag the left and right borders of the new partition rectangle to place lots of empty space to the left and right.
4) Commit changes.
At the end, there should be just your small new partition in the middle with lots of empty space to the left and right of it.
FWIW, I have used both USB flash drives and spinning hard drives with large swathes of bad sectors. Sometimes there's enough good space left to do some things with. My typical usage is to only use a very small part of what's remaining to create a boot stub to boot up something else (typically net boot).
Or, if there's enough space, I do a minimal install so I can use it as an emergency recovery OS.
But like ... this is all "scraping the bottom of the barrel" cheapskate things to do.
I've been that desperate to scrape the bottom of the barrel, though, so ... just letting you know that it is indeed possible to get long term use out of a flash drive or hard drive with bad sectors. It's not always a sign that it's going to get worse and worse until ultimate failure in the short term.
(In contrast, if a spinning hard drive starts screeching like crazy, it's toast. It might work for a little bit longer, but it's pretty hopeless.)
AFAIK, it's the partitioning tool that Ubuntu and Ubuntu based distributions use by default. It's likely already installed, if you have any tools for modifying partitions at all.
Speaking of cheapskate, I got it for like $12 at Walmart online and it has like a 11MB/sec write rate but still, I would like to be able to use near to all of it if I can. It is what I have that can hold like my Ubuntu system now. X E.
Like my bootable USB has gparted though. Should I use that? I have already tried erase entire USB with Disks and remake a partition before on this USB. X E.
USB flash drive. I tried deleting whole partition and starting with a 151MB empty space, then main ext4 storage, same result. It needs to be repaired after just repairing it. I guess abandon this and maybe use it as NTFS for like my Windows computers. X E.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.