LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error opening /dev/sdb:Permission denied (https://www.linuxquestions.org/questions/linux-newbie-8/error-opening-dev-sdb-permission-denied-766313/)

Neo@Matrix 11-02-2009 03:12 PM

Error opening /dev/sdb:Permission denied
 
First post on this forum ,forgive me , I'm newbie to Linux .TY for taking time to read my question.
I am sick & tired of MS & seeking for substitute OS for me. The test machine is my Asus eee PC 4G Surf.
Installed Jaunty Ubuntu 9.04 from USB Flash drive.
Tried to format the SD card with Gnome format tool downloaded with add/remove Application.
After confirmation of formatting it returned this msg :
Error opening /dev/sdb:Permission denied

By accessing the SD card I can read the content, but not able to delete any of it. The card reader is internal.Most likely infected with conficker worm (the autorun.ini file).

Any help will be more than welcome.:newbie:

JohnGraham 11-02-2009 03:31 PM

Quote:

Originally Posted by Neo@Matrix (Post 3741721)
After confirmation of formatting it returned this msg :
Error opening /dev/sdb:Permission denied

Try doing it as the root user. BE CAREFUL FORMATTING THINGS AS A ROOT USER - THE PROGRAMS YOU USE WILL HAPPILY OVERWRITE /dev/sda IF YOU TELL THEM TO, SO MAKE SURE YOU CHECK BEFORE YOU CLICK THAT 'OK' BUTTON!

John G

Neo@Matrix 11-02-2009 03:35 PM

Quote:

Originally Posted by JohnGraham (Post 3741753)
Try doing it as the root user. BE CAREFUL FORMATTING THINGS AS A ROOT USER - THE PROGRAMS YOU USE WILL HAPPILY OVERWRITE /dev/sda IF YOU TELL THEM TO, SO MAKE SURE YOU CHECK BEFORE YOU CLICK THAT 'OK' BUTTON!

John G

How can I do it as ROOT?

JohnGraham 11-02-2009 03:51 PM

Quote:

Originally Posted by Neo@Matrix (Post 3741756)
How can I do it as ROOT?

Every *nix system, including Linux, has a user called the 'superuser' or the 'root' user, with username 'root' and a user id of 0. Basically, this user can do whatever they want, while other users can only do things that the root user lets them. One of the things root has to let you do is write to mountable devices, like the SD card you have.

What distribution are you using? You're normally asked for a root password when you installed your distro. Usually, you can open a terminal and type the command `su', and that will log you in as the root user and then all the commands you type in from there will be run as root. So, you type in `su', run the command for whatever formatting program you want, then type `exit' and you'll be back to your normal user status.

On Ubuntu, root isn't given a password by default, but the first user to have an account will be able to use the `sudo' command to run individual commands. So, instead of typing `program-name --argument' to run your program as a normal user, you'd type `sudo program-name --argument' to run your program as the root user, and then everything should be dandy.

Remember - the root user is able to overwrite any file, including important system files, without any warning whatsoever, so always be careful what you type and do as little work as possible as root.

For more info, look at the man pages for `su' and `sudo'.

John G

Neo@Matrix 11-02-2009 04:39 PM

What distribution are you using?

On Ubuntu, root isn't given a password by default, but the first user to have an account will be able to use the `sudo' command to run individual commands. So, instead of typing `program-name --argument' to run your program as a normal user, you'd type `sudo program-name --argument' to run your program as the root user, and then everything should be dandy.


As I wrote ,I use Ubuntu 9.04 ,
I tried the command :
sudo format/dev/sdb what is most likely not correct :scratch:
But as I said , I have no experience with Linux at all
I know it is pretty much to ask , but if U could write the whole command line instead of `sudo program-name --argument'
it would make much easier for both of us. lol
I have no idea , what to write for program name or argument.
I know what should I do under windows , but I want to learn to use Linux.This is like homework for me .
Basically no one near me uses Linux at all .

When I read property tab on device , the filesystem type is MSDOS
The permission tab has info like: The permission of "NEW VOLUME"could not be determined.
ALSO only 967.5MB is the visible size of the 2Gb size of the card?!

TY very much on effort :) and Your time

halborr 11-02-2009 04:55 PM

You'll probably want to use fdisk as it is the standard (actually I think gparted is a frontend for fdisk), although it is a little cryptic (and scary!). cfdisk is the console front end for fdisk.

The man page of fdisk should tell you how to use it if you choose that ("man fdisk"), cfdisk and gparted are fairly self-explanatory. Just make SURE that you're formatting /dev/sdb and not /dev/sda.

You'll either have to run it as root or enable write permissions for your regular user (I believe if you mount it and then "cd" to /media or wherever it gets mounted to "ls -l" should give you the current permissions.)

(Kind of long winded but I think I answered your question in there somewhere...)

JohnGraham 11-02-2009 05:27 PM

Quote:

Originally Posted by Neo@Matrix (Post 3741811)
As I wrote ,I use Ubuntu 9.04 ,
I tried the command :
sudo format/dev/sdb what is most likely not correct :scratch:
But as I said , I have no experience with Linux at all
I know it is pretty much to ask , but if U could write the whole command line instead of `sudo program-name --argument'
it would make much easier for both of us. lol
I have no idea , what to write for program name or argument.

Oh - sorry, my bad, should read these things! :p

Yeah, the 'gparted' program is probably your best bet for a nice GUI, and is a front-end to several programs you might need to use.

I think gparted is installed by default in Ubuntu. From a terminal, try:

Code:

sudo gparted
If that doesn't work, you probably don't have gparted installed - type:

Code:

sudo apt-get install gparted
to install, then run the above again.

John G

Neo@Matrix 11-02-2009 05:41 PM

Quote:

Originally Posted by halborr (Post 3741828)
You'll probably want to use fdisk as it is the standard (actually I think gparted is a frontend for fdisk), although it is a little cryptic (and scary!). cfdisk is the console front end for fdisk.

The man page of fdisk should tell you how to use it if you choose that ("man fdisk"), cfdisk and gparted are fairly self-explanatory. Just make SURE that you're formatting /dev/sdb and not /dev/sda.

(Kind of long winded but I think I answered your question in there somewhere...)


My goal is to: 1.make this drive usable.
2.to remove write protection.
3.format it to any extension usable with Linux
The SD card is useless this way.It is locked (write protected)
nothing important would be lost :D
In worst case I will reinstall Linux on AsusEee

Neo@Matrix 11-02-2009 05:45 PM

Quote:

Originally Posted by JohnGraham (Post 3741860)
Oh - sorry, my bad, should read these things! :p

Yeah, the 'gparted' program is probably your best bet for a nice GUI, and is a front-end to several programs you might need to use.

I think gparted is installed by default in Ubuntu. From a terminal, try:

Code:

sudo gparted
If that doesn't work, you probably don't have gparted installed - type:

Code:

sudo apt-get install gparted
to install, then run the above again.

John G

:D Now we are talking LOL
This is what I was looking for ...
Right type of answer for the one like me , who is a:newbie:
UR the man!!
TY very much

GrapefruiTgirl 11-02-2009 05:53 PM

Hello Neo, welcome to LQ!

Looks like you guys are pretty much along the right track(s) here so far, so I am not going to start giving additional instructions and confusing the issue.
I want however, to suggest that you either *not* use those different colors in your posts, or use them more carefully -- as some of your posts above are terribly difficult to read, particularly where that light-green color is used.

Instead of the colors, consider using [u] for underline, [i] for italics, or [b] for bold when you want to emphasize something, and also using the
Code:

tags
and
Quote:

tags
when you wish to either put some console output or a chunk of code, or to quote what another member has written. This will make things much more readable :). All of the bb-code tags are like this: [BLAH] in square brackets, and [/BLAH] with a slash in the closing tag; many of them have a clickable method of doing them when you use the 'Advanced" editor to edit your post, or see the B, I, and U buttons in the "Quick Reply" dialog at the bottom of the page.

Kind regards, and again, welcome to LQ! Best of success.

Sasha

Neo@Matrix 11-02-2009 06:10 PM

Ok ,ThX I'll will use it more carefully (the colors) :)

I tried the gparted , and it looks like this :
http://img35.imageshack.us/img35/833...gparted.th.png

http://img35.imageshack.us/img35/833...sdbgparted.png

The drive is still not editable. :S
The boot flag can't be removed , not able to create new partition table .

cantab 11-02-2009 06:23 PM

Check the write protect tab physically on the SD card isn't set on.

Neo@Matrix 11-02-2009 06:31 PM

Wether it is on or off , it is all the same :S.
I have tried in both position, makes no difference , but thx :)

Neo@Matrix 11-03-2009 03:23 AM

Hmmm...Still unable to do anything with SD card...
Is there something else I can try?
Brutal force? Trash can?

JohnGraham 11-03-2009 03:37 AM

Quote:

Originally Posted by Neo@Matrix (Post 3741937)
Wether it is on or off , it is all the same :S.
I have tried in both position, makes no difference , but thx :)

Sounds like it might be mounted read-only - post the output of the `mount' command when the SD card is in.

John G


All times are GMT -5. The time now is 10:33 AM.