Page 1 of 1

fdisk -l permission denied

Posted: Sat Apr 02, 2016 10:31 pm
by foxint
Sir...
the journey continues....

Each time I follow a step toward networking I get stopped:

pi@raspberrypi:~ $ fdisk -l
fdisk: cannot open /dev/ram0: Permission denied
fdisk: cannot open /dev/ram1: Permission denied
fdisk: cannot open /dev/ram2: Permission denied
fdisk: cannot open /dev/ram3: Permission denied
fdisk: cannot open /dev/ram4: Permission denied
fdisk: cannot open /dev/ram5: Permission denied
fdisk: cannot open /dev/ram6: Permission denied
fdisk: cannot open /dev/ram7: Permission denied
fdisk: cannot open /dev/ram8: Permission denied
fdisk: cannot open /dev/ram9: Permission denied
fdisk: cannot open /dev/ram10: Permission denied
fdisk: cannot open /dev/ram11: Permission denied
fdisk: cannot open /dev/ram12: Permission denied
fdisk: cannot open /dev/ram13: Permission denied
fdisk: cannot open /dev/ram14: Permission denied
fdisk: cannot open /dev/ram15: Permission denied
fdisk: cannot open /dev/mmcblk0: Permission denied
fdisk: cannot open /dev/sda: Permission denied
pi@raspberrypi:~

What does this mean and how do I fix??

Please????

Re: fdisk -l permission denied

Posted: Sat Apr 02, 2016 10:35 pm
by stderr
foxint wrote:Each time I follow a step toward networking I get stopped:
pi@raspberrypi:~ $ fdisk -l
fdisk: cannot open /dev/ram0: Permission denied
What does this mean and how do I fix??
You are trying to do something that is restricted to root level access, so you'll need to tell the system you are serious by putting a sudo in front of the command and then typing your password:

sudo fdisk -l

Re: fdisk -l permission denied

Posted: Sat Apr 02, 2016 11:01 pm
by foxint
Sir
it worked...thank you....thank you!!!.

I am trying to make a NAS.....I have attached a HDD via USB....I get all this stuff......

What am I lookign for??

Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mmcblk0: 28.8 GiB, 30908350464 bytes, 60367872 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000a9024

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 2289062 2280871 1.1G e W95 FAT16 (LBA)
/dev/mmcblk0p2 2289063 60367871 58078809 27.7G 5 Extended
/dev/mmcblk0p5 2293760 2359293 65534 32M 83 Linux
/dev/mmcblk0p6 2359296 2488319 129024 63M c W95 FAT32 (LBA)
/dev/mmcblk0p7 2490368 60367871 57877504 27.6G 83 Linux

Disk /dev/sda: 931.5 GiB, 1000156954624 bytes, 1953431552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9e4c767d

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 1953427455 1953425408 931.5G 7 HPFS/NTFS/exFAT

Re: fdisk -l permission denied

Posted: Sat Apr 02, 2016 11:47 pm
by stderr
foxint wrote:.I get all this stuff......What am I lookign for??
Disk /dev/ram0:
There are a lot of ram drives in there messing with things, so filter them out with grep:

sudo fdisk -l | grep -v -e ram -e size -e Units

This is brute force matching and removing the lines with "ram" or "size" or "Units" that are part of the ram drive output and not displaying them leaving all the drives that are not ram drives and then you should see what you want. Usually the /dev/mmcblk stuff are sdcards and the /dev/sda and /dev/sdb etc. are usb flash drives or harddrives that are usb.

Re: fdisk -l permission denied

Posted: Sat Apr 02, 2016 11:57 pm
by foxint
Hi
Thank you

Not sure what you told me....but I did the copy and paste and it was a lot clearer...not sure what all the stuff is... all I have is a SD card and a HHD attached....mouse keyboard...

I tried to mount the drive....why does it not work like the instructions???? :cry: :cry:

pi@raspberrypi:~ $ mount -t auto /dev/sda1 /media/suppliers
mount: only root can use "--types" option
pi@raspberrypi:~ $

I followed some guys instructions and this is what happens????
Confused and upset..... :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:

Re: fdisk -l permission denied

Posted: Sun Apr 03, 2016 12:12 am
by stderr
foxint wrote:Not sure what you told me....but I did the copy and paste and it was a lot clearer...not sure what all the stuff is...
It's nothing clever at all but save it because you can continue to use it whenever you need to use fdisk.
I tried to mount the drive....why does it not work like the instructions????
Because either the instructions are wrong or for some other version or the writer is making assumptions.
pi@raspberrypi:~ $ mount -t auto /dev/sda1 /media/suppliers
mount: only root can use "--types" option
pi@raspberrypi:~ $
You need to put sudo in front of the mount command. The writer is assuming that you know that, apparently. Or, perhaps, he's using the # prompt which doesn't need the sudo. Does the tutorial have a # prompt or a $ prompt? Watch out for this, write it down in your notes.

Re: fdisk -l permission denied

Posted: Sun Apr 03, 2016 12:52 am
by foxint
Sir
totally confused

thsi is what I did:

pi@raspberrypi:/ $ sudo mount -t auto /dev/sda1/media/suppliers
mount: can't find /dev/sda1/media/suppliers in /etc/fstab
pi@raspberrypi:/ $

:cry: :cry: :cry: :cry: :cry:

Re: fdisk -l permission denied

Posted: Sun Apr 03, 2016 12:58 am
by stderr
foxint wrote:pi@raspberrypi:/ $ sudo mount -t auto /dev/sda1/media/suppliers
mount: can't find /dev/sda1/media/suppliers in /etc/fstab
It really is sudo mount sourceDevice destinationDirectory in this format so it would seem like you didn't put a space there:

sudo mount -t auto /dev/sda1 /media/suppliers

Notice that there will need to be a directory called /media/suppliers which won't exist if you didn't make it. So, before doing the above, do this:

sudo mkdir -p /media/suppliers

Re: fdisk -l permission denied

Posted: Sun Apr 03, 2016 1:12 am
by foxint
Sir
Thank you...I really cannot see the spaces or the difference...

But I have copied and pasted.....

pi@raspberrypi:/ $ sudo mkdir -p /media/suppliers
pi@raspberrypi:/ $ sudo mount -t auto /dev/sda1 /media/suppliers
Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted, or another software may use it which
could be identified for example by the help of the 'fuser' command.
pi@raspberrypi:/ $

cry:

Does this mean I have it or not??

Re: fdisk -l permission denied

Posted: Sun Apr 03, 2016 2:11 am
by stderr
foxint wrote:Mount is denied because the NTFS volume is already exclusively opened.
The volume may be already mounted,
Does this mean I have it or not??
I think that it mounted on its own. If you are using the GUI and you open up its file manager or maybe if you just have it installed, the default is to open it up, I think mounted in /media under some directory. You should look there, it's probably already good to go. (Remember that I don't know what you actual situation is, I'm just responding to your comments, you might not need to use mount at all)

Re: fdisk -l permission denied

Posted: Sun Apr 03, 2016 2:30 am
by foxint
Sir
Totally confused.....
I have used Window Explorer and the Pi is empty.....

I ahve tried to unmount...but all of the commands on the internet are not valid...

So I want to try again....nothing I do will allow me to unmount...if it is mounted... I tried to delete the directory....but no permission... I am a bit annoyed with permissions....it is only me....

Anyone can help??? :cry:

Re: fdisk -l permission denied

Posted: Sun Apr 03, 2016 2:52 am
by foxint
Hi Guys
I want a NAS....that is all I want...everything I do is wrong:

this is what I did:
pi@raspberrypi:/ $ ls
bin home lost+found proc srv usr
boot jcameron-key.asc media root Suppliers var
dev jcameron-key.asc.1 mnt run sys webmin-setup.out
etc lib opt sbin tmp
pi@raspberrypi:/ $ sudo mount -t auto /dev/sda1/Suppliers
mount: can't find /dev/sda1/Suppliers in /etc/fstab
pi@raspberrypi:/ $ ls
bin home lost+found proc srv usr
boot jcameron-key.asc media root Suppliers var
dev jcameron-key.asc.1 mnt run sys webmin-setup.out
etc lib opt sbin tmp
pi@raspberrypi:/ $

I am totally confused.....I am trying to unmount the HDD ...orignally I tried to mount it and it said "mount denied"... but...when I view it from Webmin...I seem the HDD...now webmin says "Error - File not found"

The more I fix the more it become worse..... :cry: :cry: :cry:

Re: fdisk -l permission denied

Posted: Sun Apr 03, 2016 2:58 am
by foxint
Hi Guys

The whole pi stopped nothing would reboot.... I pulled the power and put it back...

Now it asks me to install the OS.....

Is there any way to make the simple....almost 14 days of HELL....this is the most irritating device in the world

Thanks for the help...but I will have to start this process all over again......