1

I formated a hard drive with ext4 using sudo mkfs -t ext4 /dev/sda, I also tried using the KDE partition manager with the same result:

A "lost+found" folder appears when I mount and open the drive and when I want to create a directory using mkdir test, I get the answer Permission denied.

Does anyone know how I can make the hard drive work again?

3
  • ehm, after answering I noticed that you created the file system on /dev/sda. I hope that's a type, otherwise: you should create filesystems in the partition (/dev/sda1) and not on the complete disk (/dev/sda). Commented Dec 25, 2022 at 14:34
  • It really depends on your needs. Partitioning is not exactly crucial.
    – Tom Yan
    Commented Dec 25, 2022 at 15:28
  • I tried both. When I used the partition manager it made a partition table like it was before (I hope) Commented Dec 25, 2022 at 21:21

1 Answer 1

2

This is most likely a permission problem. If you do

sudo mkdir test
sudo chown your_user_id test

you should be able to create your own stuff under test.

If you chown and/or chmod the top of the file system when it is mounted, it should be accessible for the right users.

One word of caution: do not make everything world-writable. If you have multiple users, give them their own directory (like you did with test)

3
  • The uid mount options applies only to a few filesystem types, namely those non-linux ones.
    – Tom Yan
    Commented Dec 25, 2022 at 15:27
  • Thank you so much, this worked for me and now I can use it to copy files. And how can I make the disk useable again for any user? Also to create files in the root dir of the disk? Commented Dec 25, 2022 at 21:21
  • @TomYan You're right. Forgot that this was ext4. Commented Dec 27, 2022 at 12:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .