LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   parted -l and fdisk -l commands not working in terminal (https://www.linuxquestions.org/questions/linux-newbie-8/parted-l-and-fdisk-l-commands-not-working-in-terminal-4175733455/)

yourimiessen@outlook.be 02-02-2024 09:25 AM

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?

michaelk 02-02-2024 06:19 PM

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.

rnturn 02-02-2024 07:08 PM

Quote:

Originally Posted by yourimiessen@outlook.be (Post 6480875)
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.)

michaelk 02-02-2024 07:37 PM

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.

yourimiessen@outlook.be 02-18-2024 08:08 AM

Hello guys

I was indeed running as admin and not root!

putting sudo infront of the command solved the issue :)

Thx a lot!!


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