Score:4

Do you know a way to fix a Ext4 partition that is mounted, fstab but still won't work * lost+found?

tk flag

I installed Kubuntu 22.04 Kernel Ver. 6.2.0-31, and it partitioned a Ext4 on my SSD for the system and left my previous files on a NTFS partition. I did not really need the old files so I tried to partition the rest of the drive to Ext4 so it all could be used by Kubuntu installations. (It is Not a dual boot) The drive does not work and shows lost+found file.

It shows up in the terminal, in Dolphin, and KDE Partition Mgr. Using KDE Partition Manager, I unmounted, I deleted it, reformatted it Ext4, relabeled it SSD2, and it automatically mounted. I try to use the drive, all that is there is a lost and found folder, and it reads "could not enter folder /home/unity/media/lost+found" First attempt I used the terminal with the exact same results. I have looked in the fstab and it shows there.

I got the name home/unity/media from a path presented by KDE Partition Manager I believe when setting the mount point.

$ stat /home/unity/media
  File: /home/unity/media
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 801h/2049d      Inode: 2           Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-09-01 18:13:28.895361456 -0500
Modify: 2023-09-01 18:11:32.000000000 -0500
Change: 2023-09-01 18:11:32.000000000 -0500
 Birth: 2023-09-01 18:11:32.000000000 -0500
$
$ findmnt --fstab
TARGET            SOURCE                                    FSTYPE OPTIONS
/                 UUID=8256fca0-2723-4e9a-bc64-ac669b1cdd7d ext4   errors=remount-ro
/boot/efi         UUID=A9EF-3FF7                            vfat   umask=0077
none              /swapfile                                 swap   sw
/home/unity/media /dev/sda1
$

                         ext4   rw,relatime,errors=remoun
└─/var/snap/firefox/common/host-hunspell /dev/sda5[/usr/share/hunspell] ext4   ro,noexec,noatime,errors=
                     ext4   rw,relatime,errors=remoun
├─/var/snap/firefox/common/host-hunspell /dev/sda5[/usr/share/hunspell] ext4   ro,noexec,noatime,errors=
└─/home/unity/media
df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           1.6G  1.6M  1.6G   1% /run
/dev/sda5        74G   16G   54G  23% /
tmpfs           7.8G     0  7.8G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
/dev/sda1       145G   28K  138G   1% /home/unity/media
/dev/sda2       512M  6.1M  506M   2% /boot/efi
tmpfs           1.6G   52K  1.6G   1% /run/user/1000
/dev/sdb1       100M   26M   75M  26% /media/unity/SYSTEM
/dev/sdb5        98G   89M   98G   1% /media/unity/New Volume
/dev/sdb2       1.8T  422G  1.4T  25% /media/unity/MAIN DRIVE
lsblk -e 7
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 223.6G  0 disk 
├─sda1   8:1    0 148.2G  0 part /home/unity/media
├─sda2   8:2    0   513M  0 part /boot/efi
├─sda3   8:3    0     1K  0 part 
└─sda5   8:5    0  74.8G  0 part /var/snap/firefox/common/host-hunspell
                                 /
sdb      8:16   0   1.8T  0 disk 
├─sdb1   8:17   0   100M  0 part /media/unity/SYSTEM
├─sdb2   8:18   0   1.7T  0 part /media/unity/MAIN DRIVE
├─sdb3   8:19   0     1K  0 part 
├─sdb4   8:20   0  11.2G  0 part 
└─sdb5   8:21   0  97.7G  0 part /media/unity/New Volume
sdc      8:32   1     0B  0 disk 
sdd      8:48   1     0B  0 disk 
sde      8:64   1     0B  0 disk 
sdf      8:80   1     0B  0 disk 
sr0     11:0    1   1.6G  0 rom
findmnt -t ext4

TARGET SOURCE FSTYPE OPTIONS / /dev/sda5 ext4 rw,relatime,errors=remoun └─/var/snap/firefox/common/host-hunspell /dev/sda5[/usr/share/hunspell] ext4 ro,noexec,noatime,errors=

I don’t know if this is appropriate, but for learning purposes, these are the two submissions that pushed me into the solution to my currently operating EFI dev/sda1 SSD. Plus every time I was given a code example.

@Nishnabe /home/unity/media is not a standard mount point. How exactly did you mount it there? Add the output of stat /home/unity/media to the post using a code block please –> muru 15 hours ago

You will need to run sudo chown USER: /home/unity/media while the partition is mounted. You created the mountpoint with sudo thus it's owned by root, own it back to your user and you will be able to paste and copy files into it. –> mook765 5 hours ago

The solution that fixed my error.

unity@unity-p7-1297c:~$ sudo umount /home/unity/media 

unity@unity-p7-1297c:~$ sudo rmdir /home/unity/media

unity@unity-p7-1297c:~$ sudo mkdir /mnt/SSD2

unity@unity-p7-1297c:~$ sudo mount -t auto /dev/sda1 /mnt/SSD2

unity@unity-p7-1297c:~$ sudo chmod a+rwx /mnt/SSD2/

us flag
Can you try formatting using the KDE Partition manager or GParted?
mook765 avatar
cn flag
If you want a partition to be shown in dolphin, mount it somewhere under `/media`, for example `/media/data`. If you mount a partition elsewhere like in your case `/home/unity/SSD2` the partition will not be displayed in dolphin, but you can browse to the mountpoint to explore the contents of the partition.
mook765 avatar
cn flag
A fresh formattet partition is empty exept the `lost+found`-folder which is owned by _root_, as a normal user you cannot enter this folder.This folder should be empty since its a new partition. I don't see anything wrong here. What do you mean when you say `the drive does not work`?
Nishnabe avatar
tk flag
When I select the partitioned drive (SSD2) the only thing on the drive is that lost+found folder, when I open it Dolphin file mgr. "Could not enter folder /home/unity/media/lost+found. When I run lsblk -f it shows it mounted at 0% (I can not put anything on the drive)
muru avatar
us flag
@Nishnabe `/home/unity/media` is not a standard mount point. How exactly did you mount it there? Add the output of `stat /home/unity/media` to the post using a [code block] please
Raffa avatar
jp flag
... Also please add the output of `findmnt --fstab` and of `findmnt -t ext4`
Raffa avatar
jp flag
@mook765 ... Better to wait on `chmod` for now, I think ... `/dev/sda1` should be the EFI partition and there appears nothing to be actually mounted at `/home/unity/media` ... @Nishnabe Please, also add the output of `df -h` and `lsblk -e 7`
Raffa avatar
jp flag
It appears that you skipped copying part of the last line in the output of `findmnt -t ext4` … Your filesystem, however, seems to be mounted and ready to use … `lost+found` is created with the filesystem as part of the other special inodes and it has permissions only for the `root` Owner user and none for group or others … In addition to setting permissions on the mount point, the mount options `user,exec` in `fstab` might help as well … @mook765 Sorry for holding you back on a false alarm :-) … It’s your call now.
mook765 avatar
cn flag
You will need to run `sudo chown USER: /home/unity/media` while the partition is mounted. You created the mountpoint with `sudo` thus it's owned by _root_, own it back to your user and you will be able to paste and copy files into it.
nobody avatar
gh flag
`sudo chown -R $USER:$USER /home/unity/media`
Nishnabe avatar
tk flag
The drive works now. I wrote down what fixed it in the question.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.