LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-10-2022, 10:07 AM   #1
bingusboingus
LQ Newbie
 
Registered: Nov 2022
Posts: 3

Rep: Reputation: 0
Question Permission Denied While Root?


Hello! I'm trying to mount a drive, and using the following command to mount:

sudo mount /dev/sda /dat

Even while being root or using sudo, I get the following error:

mount: /dat: permission denied.

Could someone tell me what I am doing wrong? Thank you!
 
Old 11-10-2022, 10:17 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,160

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
Is the drive partitioned? Although it is possible to write a filesystem onto the whole sda drive, normally a drive has a label and at last one partition.

For example, the first partition of /dev/sda would be /dev/sda1. To mount that partition: sudo mount /dev/sda1 /dat
 
2 members found this post helpful.
Old 11-10-2022, 10:52 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Spot on. /dev/sda is a reference to the entire device, but only partitions can be "mounted."
 
1 members found this post helpful.
Old 11-10-2022, 03:43 PM   #4
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
Permission denied, probably you have a login shell sitting in /dat. It won't mount a filesystem where any process's cwd is sitting in the directory.
 
Old 11-10-2022, 07:59 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,384
Blog Entries: 28

Rep: Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164Reputation: 6164
Have you created a mount point?

Normally, you create a mount point for a partition, then you mount the mount point, rather than mounting the device directly.
 
Old 11-11-2022, 12:28 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,152

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Quote:
Originally Posted by sundialsvcs View Post
Spot on. /dev/sda is a reference to the entire device, but only partitions can be "mounted."
Nope.
Filesystems get mounted - it is certainly possible to define a filesystem over a device node without creating a partition table.
 
1 members found this post helpful.
Old 11-11-2022, 03:58 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,484

Rep: Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556Reputation: 1556
Quote:
Originally Posted by syg00 View Post
Nope.
Filesystems get mounted - it is certainly possible to define a filesystem over a device node without creating a partition table.
There's one sysadmin that used to work with my current company that did that, a lot, made troubleshooting a bit strange until you remembered what he liked to do.
 
Old 11-11-2022, 04:44 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
this is just the duplication of your other thread.
What is in /dat? How was it created? You need to check that (it was a dir at all). Permisison denied means the mount itself will try to attempt to modify something which is not allowed, but we don't know how is your system configured.
Code:
       EPERM  The caller does not have the required privileges.

       EPERM  An attempt was made to modify (MS_REMOUNT) the MS_RDONLY,
              MS_NOSUID, or MS_NOEXEC flag, or one of the "atime" flags
              (MS_NOATIME, MS_NODIRATIME, MS_RELATIME) of an existing
              mount, but the mount is locked; see mount_namespaces(7).
 
Old 11-11-2022, 08:55 AM   #9
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,832

Rep: Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219Reputation: 1219
Check with
Code:
lsblk
if it is used by something (swap, lvm, partition,...).

Mount point missing or busy gives other error messages.

Last edited by MadeInGermany; 11-11-2022 at 08:59 AM.
 
Old 11-11-2022, 09:29 AM   #10
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
Quote:
Originally Posted by MadeInGermany View Post
Check with
Code:
lsblk
if it is used by something (swap, lvm, partition,...).

Mount point missing or busy gives other error messages.
Timeshift does that and if I remember well the partition stays mounted when you shut the application.
 
  


Reply

Tags
question



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Redhat linux 6.1: Permission denied while copying a file using sftp with root user sayub76 Linux - Newbie 11 05-18-2017 03:13 AM
[SOLVED] Permission denied as root to a root-owned directory threevolve Ubuntu 3 06-06-2013 07:27 AM
mkdir throws Permission Denied error in a directoy even with root ownership and 777 permission surajchalukya Linux - Security 14 09-03-2012 08:34 AM
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 04:50 AM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration