Hi! I’ve been formatted my 1TB drive to ext2 (as formatting to ext 4 didn’t work making USB completely unusable) with sudo mkfs.ext2 /dev/sdb1
command. While it made USB recognizable inside Thunar file manager (I was able to open it) it didn’t allow to copy anything to it giving me Permission denied
error all the time. I tried to follow some advices from internet and used sudo chown -R "$(whoami)" /dev/sdc; sudo chown -R "$(whoami)" /dev/sdc1
and sudo chmod -R 777 /dev/sdc; sudo chmod -R 777 /dev/sdc1
and it didn’t help (even after mounting/unmounting). Gnome disks failed to change ownership either, even when I used them via sudo gnome-disks
. I have no clue what’s going on but I need this drive working without this problems.
You need to change the ownership of the mount point not the device (sdb1 or sdc1). Secondary drives are generally available under the /media/username directory so check to see if the drive shows there to change ownership. Additional /external drives are mounted with root (sudo) ownership and are generally shown by UUID. The link below gives examples of changing ownership using the terminal as well as the Disks software.
https://askubuntu.com/questions/1424007/how-to-change-permissions-on-an-external-drive
You need to mount the drive and then change ownership of the mountpoint:
- insert the drive
- right-click your drive in the Thunar sidebar > Open
- right-click > Open Terminal Here, and run
sudo chown -c "$(whoami):" .
* The colon in the above command is intentional to also change the drive to your group. For more info see man chown
What exactly didn’t work and how was it unusable?
I would add two more points:
- what do you want to do with the drive, is it for installation or storage (possibly shared with Windows)?
- “FAT, exFAT, ext2, and HFS provide neither journaling nor atomicity, They are for temporary or legacy use and not recommended for use when reliable storage is needed.” Reference here.
You don’t chown the block device. You chown the data once it is mounted. Instead of "$(whoami)"
, just use $USER
Much easier and cleaner. It’s a BASH variable that holds the current user’s username.
Is this a flash drive or SSD?
And from a reliable brand?
We have seen multiple cases of users buying very low cost drives, SSDs, flash drives that are not what they say they are. Often only has a tiny flash drive inside that has been modified to say it is a lot larger.
The issue is that you’re changing permissions on the device node (/dev/sdc1) instead of the mounted filesystem. After formatting with mkfs.ext2, you need to mount the drive (e.g., sudo mount /dev/sdc1 /mnt/myusb), then change ownership of the mount point, not the device: sudo chown -R $USER:$USER /mnt/myusb. That will give you permission to read/write. Also, avoid using chmod 777 on device files—it doesn’t affect mounted data and may introduce risks.
What to do if I have this input/output error:
emilygraceseville7cf@emilygraceseville7cf-laptop:~$ mount | grep /dev/
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sda2 on / type ext4 (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,pagesize=2M)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /media/emilygraceseville7cf/EMILY DRIVE type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
/dev/sdc1 on /media/emilygraceseville7cf/4892de44-ab1a-40fa-b72c-1713c7d8c558 type ext3 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2)
emilygraceseville7cf@emilygraceseville7cf-laptop:~$ sudo chown $USER:$USER /media/emilygraceseville7cf/4892de44-ab1a-40fa-b72c-1713c7d8c558
[sudo] password for emilygraceseville7cf:
chown: changing ownership of '/media/emilygraceseville7cf/4892de44-ab1a-40fa-b72c-1713c7d8c558': Input/output error
emilygraceseville7cf@emilygraceseville7cf-laptop:~$
? I don’t understand why it’s happening. -c
flag before $USER:$USER
didn’t help either…
oldfred’s questions in post #6 could be relevant for troubleshooting that.
Also, does this command return anything? -
sudo smartctl -a /dev/sdc
If you don’t have smartctl
, you can install it with:
sudo apt install smartmontools
* smartctl
does not require the background smartd
service, so if you don’t want that part on your system, you can disable it with
sudo systemctl disable --now smartd
I would start by running fsck on sdc1 from a functional Linux install making sure that sdc1 is not mounted when running fsck (use sudo) Check logs, . /var/log/syslog, /var/log/messages and if the problem is not resolved, run hardware diagnostic on the drive/partition.
emilygraceseville7cf@emilygraceseville7cf-laptop:~$ sudo smartctl -a /dev/sdc
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.8.0-63-generic] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org
/dev/sdc: Unknown USB bridge [0x048d:0x1234 (0x100)]
Please specify device type with the -d option.
Use smartctl -h to get a usage summary
Is it a normal output?
It can be normal, it just means smartctl
can’t check this drive’s hardware health info over USB.
What’s more concerning is these two results from a quick search for your USB drive as identified in that output:
https://superuser.com/a/1307640
Not sure how/if those results might relate to this case or what to suggest from here, but for others to be able to help you further, could you please answer the questions @oldfred asked above? -
Here’s what is written my my USB drive: Kingston, DTSE9 1TB 04753–503.AOOLF, KFY 8583524052, 5V TAIWAN.
While Kingston is normally a good brand, I found this:
new Kingston drives have a serial number on the USB connector, etched on it with a laser. If this laser etching is missing, you are looking at a counterfeit drive.
I see multiple Kingston drives on Amazon. All seem to be newer faster drives and 1GB is around $100.
While some flash drives now are much faster than the ones I bought years ago, I now use an external USB to NVMe adapter to create an external SSD. Much faster and depending on size of drive not all that much more expensive. Adapter on the order of $20. I prefer Samsung, but its more expensive at $75 for 1TB EVO. Some other good brands bit lower in cost.