LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-02-2024, 09:25 AM   #1
yourimiessen@outlook.be
LQ Newbie
 
Registered: Feb 2024
Posts: 4

Rep: Reputation: 0
Question parted -l and fdisk -l commands not working in terminal


Hello guys

When I run the parted -l command I just get my command prompt back as an output.
When I run the fdisk -l command, I get the foll. output:

youri@desktop-van-yourimiessen:~$ fdisk -l
fdisk: cannot open /dev/loop0: Permission denied
fdisk: cannot open /dev/loop1: Permission denied
fdisk: cannot open /dev/loop2: Permission denied
fdisk: cannot open /dev/loop3: Permission denied
fdisk: cannot open /dev/loop4: Permission denied
fdisk: cannot open /dev/loop5: Permission denied
fdisk: cannot open /dev/loop6: Permission denied
fdisk: cannot open /dev/loop7: Permission denied
fdisk: cannot open /dev/sda: Permission denied
fdisk: cannot open /dev/loop9: Permission denied
fdisk: cannot open /dev/loop10: Permission denied
fdisk: cannot open /dev/loop8: Permission denied
fdisk: cannot open /dev/loop11: Permission denied
fdisk: cannot open /dev/loop12: Permission denied
fdisk: cannot open /dev/loop13: Permission denied
fdisk: cannot open /dev/loop14: Permission denied
fdisk: cannot open /dev/loop15: Permission denied
fdisk: cannot open /dev/loop16: Permission denied
fdisk: cannot open /dev/loop17: Permission denied
fdisk: cannot open /dev/loop18: Permission denied
fdisk: cannot open /dev/loop20: Permission denied
fdisk: cannot open /dev/loop19: Permission denied
fdisk: cannot open /dev/loop21: Permission denied
fdisk: cannot open /dev/loop22: Permission denied
fdisk: cannot open /dev/loop23: Permission denied
youri@desktop-van-yourimiessen:~$

I'm running both commands as the superuser.

So my main questions are:
-Why is the parted -l command not outputting my disk information?
-Why am I denied acces when running fdisk -l?
 
Old 02-02-2024, 06:19 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,719

Rep: Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911
What distribution are you running? If you are running Ubuntu or Mint or similar the first user is the administrator but not the superuser i.e root. The administrator is allowed to run commands as root using the sudo command.

sudo parted -l

sudo fdisk -l

You will be prompted for your user's password.

Otherwise more information is required.
 
1 members found this post helpful.
Old 02-02-2024, 07:08 PM   #3
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by yourimiessen@outlook.be View Post
Hello guys

When I run the parted -l command I just get my command prompt back as an output.
When I run the fdisk -l command, I get the foll. output:

youri@desktop-van-yourimiessen:~$ fdisk -l
fdisk: cannot open /dev/loop0: Permission denied
fdisk: cannot open /dev/loop1: Permission denied

[snip]

fdisk: cannot open /dev/loop22: Permission denied
fdisk: cannot open /dev/loop23: Permission denied
youri@desktop-van-yourimiessen:~$

I'm running both commands as the superuser.
That snippet in your post does not look like what you would normally see when running, say, fdisk -l as the superuser. (The shell prompt surely doesn't look like what I would expect the root account to be displaying.)
 
1 members found this post helpful.
Old 02-02-2024, 07:37 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,719

Rep: Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911Reputation: 5911
My guess is the OP is running Ubuntu and the loop devices are snap devices. Since fdisk was not run as sudo you see the permission denied error.
 
1 members found this post helpful.
Old 02-18-2024, 08:08 AM   #5
yourimiessen@outlook.be
LQ Newbie
 
Registered: Feb 2024
Posts: 4

Original Poster
Rep: Reputation: 0
Hello guys

I was indeed running as admin and not root!

putting sudo infront of the command solved the issue

Thx a lot!!
 
  


Reply



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
Parted Magic vs. G-parted jk07 Linux - Software 6 09-23-2012 04:46 AM
distro with fastest boot - terminal only (dd, parted, fdisk) zz^ Linux - Distributions 5 09-16-2011 06:04 PM
What app can REALLY delete a partition? (not fdisk, parted, etc...) kornerr Linux - General 4 05-28-2005 12:14 PM
fdisk/parted/cfdisk: command not found indole Linux - Software 2 02-17-2005 12:08 PM
working around PARTED bug 90894 using fdisk and resize2fs carneros Red Hat 0 07-29-2004 02:42 PM

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

All times are GMT -5. The time now is 05:44 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