Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mkdir:Permission denied
#1
I have been using Linux Mint for almost 2 years and decided to go with a minimal Debian build. However I am have an issue with making directory called backups so I can mount an external USB hard drive to this mount point.

Here are the steps I am doing in the attempt to create a directory called backups in the /media folder.

chris@debianDad:~$ whoami
chris

chris@debianDad:~$ groups
chris cdrom floppy sudo audio dip video plugdev netdev bluetooth scanner lpadmin

chris@debianDad:~$ sudo mkdir /media/backups
mkdir: cannot create directory ‘/media/backups’: Permission denied

chris@debianDad:~$ su -
Password:

root@debianDad:~# whoami
root

root@debianDad:~# mkdir /media/backups
mkdir: cannot create directory ‘/media/backups’: Permission denied

root@debianDad:~# ls -lah /media
total 4.0K
drwxr-xr-x 2 root root 0 Feb 27 13:45 .
drwxr-xr-x 19 root root 4.0K Feb 27 12:47 ..

chris@debianDad:/media$ ls -lap
total 4
drwxr-xr-x 2 root root 0 Feb 27 13:45 ./
drwxr-xr-x 19 root root 4096 Feb 27 12:47 ../

chris@debianDad:~$ cat /etc/fstab
# /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/sda2 during installation
UUID=b4fcaa5a-cf01-4a37-b305-443408e405d1 / ext4 noatime,errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=61CD-4E9C /boot/efi vfat umask=0077 0 1
# /home was on /dev/sda3 during installation
UUID=ba72b476-d9c7-424c-a5ce-34e166083a45 /home ext4 defaults 0 2
# /swapfile is a custom swap file not a partion
/swapfile none swap sw 0 0

What am I doing wrong? Any help would be greatly appreciated!
Thank you,
Chris
Reply
#2
(02-27-2020, 09:20 PM)aiwa Wrote: I have been using Linux Mint for almost 2 years and decided to go with a minimal Debian build. However I am have an issue with making directory called backups so I can mount an external USB hard drive to this mount point.

Here are the steps I am doing in the attempt to create a directory called backups in the /media folder.

chris@debianDad:~$ whoami
chris

chris@debianDad:~$ groups
chris cdrom floppy sudo audio dip video plugdev netdev bluetooth scanner lpadmin

chris@debianDad:~$ sudo mkdir /media/backups
mkdir: cannot create directory ‘/media/backups’: Permission denied

chris@debianDad:~$ su -
Password:

root@debianDad:~# whoami
root

root@debianDad:~# mkdir /media/backups
mkdir: cannot create directory ‘/media/backups’: Permission denied

root@debianDad:~# ls -lah /media
total 4.0K
drwxr-xr-x 2 root root 0 Feb 27 13:45 .
drwxr-xr-x 19 root root 4.0K Feb 27 12:47 ..

chris@debianDad:/media$ ls -lap
total 4
drwxr-xr-x 2 root root 0 Feb 27 13:45 ./
drwxr-xr-x 19 root root 4096 Feb 27 12:47 ../

chris@debianDad:~$ cat /etc/fstab
# /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/sda2 during installation
UUID=b4fcaa5a-cf01-4a37-b305-443408e405d1 / ext4 noatime,errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=61CD-4E9C /boot/efi vfat umask=0077 0 1
# /home was on /dev/sda3 during installation
UUID=ba72b476-d9c7-424c-a5ce-34e166083a45 /home ext4 defaults 0 2
# /swapfile is a custom swap file not a partion
/swapfile none swap sw 0 0

What am I doing wrong? Any help would be greatly appreciated!
Thank you,
Chris
I was did some more research and I found this Ubuntu Thread: root not able to create directory in /media
I did some digging I remembered that I had enabled autofs. So I did a systemctl status autofs and it was running and enabled. So I stop the service and disabled the service too. Once I did that I did the command ls -lah on /media and there was a directory called backups which I guess was created earlier. Odd that mkdir would not say directory existed already?

-Chris
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)