cant access

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
Krishna
Level 1
Level 1
Posts: 7
Joined: Sat Nov 18, 2023 11:32 pm

cant access

Post by Krishna »

I formatted my HDD from NTFS file system to ext4 using Gparted. When I try to copy paste my data from pen drive to that hdd , it doesnt paste. Also it doesnt show option to create folder/file.
It only shows 1TB volume.

Please help me solve this
Last edited by xenopeek on Wed Nov 29, 2023 8:26 am, edited 1 time in total.
Reason: moved to storage forum
Krishna
Level 1
Level 1
Posts: 7
Joined: Sat Nov 18, 2023 11:32 pm

Mistake in changing ownership

Post by Krishna »

I was changing my permission of my HDD from read only to read write ..

I ran the following commands with output: -

Code: Select all

cat /proc/mounts

sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=2906256k,nr_inodes=726564,mode=755,inode64 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,size=594424k,mode=755,inode64 0 0
/dev/nvme0n1p2 / ext4 rw,relatime,errors=remount-ro 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0
tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k,inode64 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0
efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=21417 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
none /run/credentials/systemd-sysusers.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
/dev/nvme0n1p1 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/nvme0n1p4 /home ext4 rw,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=594420k,nr_inodes=148605,mode=700,uid=1000,gid=1000,inode64 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
portal /run/user/1000/doc fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
/dev/sda2 /mnt/sda2 ext4 rw,nosuid,nodev,relatime 0 0
then

Code: Select all

sudo lsblk -f

[sudo] password for krishna:      
NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                
└─sda2      ext4   1.0         a65b4651-2fd2-4c51-a1e1-5cb9c8b122dd  869.1G     0% /mnt/sda2
nvme0n1                                                                            
├─nvme0n1p1 vfat   FAT32       9D40-A93A                               480M     1% /boot/efi
├─nvme0n1p2 ext4   1.0         166d944e-7a6b-467e-a11f-c855d794c8fb   40.7G    20% /
├─nvme0n1p3 swap   1           45279621-7c88-4e06-9564-2a7ffa63e8e0                [SWAP]
└─nvme0n1p4 ext4   1.0         a4709cb8-0582-4442-ac16-59ceff3c989f  361.2G     3% /home

and at last

Code: Select all

sudo ls -ld /mnt
drwxr-xr-x 3 root root 4096 Nov 29 14:24 /mnt
krishna@Urahara:~$ sudo chown ${USER}: /mnt
krishna@Urahara:~$ sudo ls -ld /mnt
drwxr-xr-x 3 krishna krishna 4096 Nov 29 14:24 /mnt
I used /mnt as mount point instead /mnt/sda2. What does it do and Is it going to cause any problem ?

I later ran above commands with /mnt/sda2.
Last edited by xenopeek on Wed Nov 29, 2023 8:26 am, edited 1 time in total.
Reason: merged with other topic about the same
User avatar
xenopeek
Level 25
Level 25
Posts: 29285
Joined: Wed Jul 06, 2011 3:58 am

Re: cant access

Post by xenopeek »

Is this a removable storage device? Then use the Disks app to format it. That makes it writable to you when you plug it in.

If instead this is a permanently attached storage device you should set it up to be mounted at boot, and make yourself the owner of the directory where you mount it. You can mount it anywhere you want but it must be an existing directory. /mnt and /media are treated special by the system so I always mount it elsewhere. For example you could create a directory in your home directory called "Disk2", or whatever name you want.

Then you can manually configure the partition to be mounted there in /etc/fstab or you can use the Disks app in your menu. In the Disks app click the partition you want to mount at boot (you may have to unmount it if it is currently mounted before you can make changes here), click the cogwheels button underneath it and choose Edit Mount Options. Disable user session defaults and enable mount at system startup, and configure the mount point to be the directory you created for it. If you want you can enable show in user interface to show it in the devices list; I always disable that because it can be accessed through its mount point directory.
Image
Krishna
Level 1
Level 1
Posts: 7
Joined: Sat Nov 18, 2023 11:32 pm

error=remount-ro 0 1

Post by Krishna »

I make my hdd mount to mnt. I some how mistakenly changed the ownership of /mnt to user instead of root. now my fstab says error=remount-ro 0 1

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=166d944e-7a6b-467e-a11f-c855d794c8fb /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=9D40-A93A  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/nvme0n1p4 during installation
UUID=a4709cb8-0582-4442-ac16-59ceff3c989f /home           ext4    defaults        0       2
# swap was on /dev/nvme0n1p3 during installation
UUID=45279621-7c88-4e06-9564-2a7ffa63e8e0 none            swap    sw              0       0
/dev/sda2 /mnt/sda2 auto nosuid,nodev,nofail,x-gvfs-show 0 0
Please help me fix it using terminal. I dont want to reinstall linux mint
Last edited by karlchen on Wed Nov 29, 2023 9:40 am, edited 2 times in total.
Reason: Appended new post to existing thread.
User avatar
xenopeek
Level 25
Level 25
Posts: 29285
Joined: Wed Jul 06, 2011 3:58 am

Re: cant access

Post by xenopeek »

Run sudo chown root: /mnt to correct the ownership of /mnt.
Krishna wrote: Wed Nov 29, 2023 9:28 am now my fstab says error=remount-ro 0 1
Your root partition should be mounted with that. It's correct.

Instead remove this line from your /etc/fstab:

Code: Select all

/dev/sda2 /mnt/sda2 auto nosuid,nodev,nofail,x-gvfs-show 0 0
Then use the Disks app to configure this partition to mount at boot. And mount it in a sensible directory, one that you own. /mnt is for temporarily mounted filesystems, you should not be using it for permanently mounting.
Image
Post Reply

Return to “Storage”