david1939
Posts: 5
Joined: Sat Mar 16, 2013 11:42 pm
Location: Gloucester Point, VA, USA

USB drive not recognized for new user

Tue Mar 19, 2013 4:51 pm

I'm new to the Pi (just got one a week ago) and don't know Linux, though not unfamiliar with computers having written my first program as a graduate student in the early 1960's.

I'm using a thumb drive to transfer files to the Pi from my PC (specifically at present, Scratch projects for grandchild to work with). When logged in as Pi, and using the X-windows, the File Manager recognizes the thumb drive & happily lets me transfer files to and fro.

However, I have also created a new user for said grandchild, adding the groups that user Pi tells me it uses. The problem is that when logged in as that user, the File Manager doesn't see the thumb drive, so I can't copy files for grandchild's use. (Rather not let him login as pi.)

So my question is: how can I make a new user see the thumb drive (and maybe any other storage device I might plug into the USB port)?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: USB drive not recognized for new user

Tue Mar 19, 2013 10:44 pm

I'm not quite sure "what's going wrong" but, whilst it's probably "overkill" for your needs, the approach I describe at http://www.cpmspectrepi.webspace.virgin ... ticks.html in my webpages might, hopefully, be of some help. Usually USB "thumb drives" just mount under the /media directory, esp. if they're (Windows) FAT32 formatted - they're not meant to be "protected" (assuming they're not encrypted, or formatted "ext3" say. with restricted directory permissions ... :) )
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

david1939
Posts: 5
Joined: Sat Mar 16, 2013 11:42 pm
Location: Gloucester Point, VA, USA

Re: USB drive not recognized for new user

Tue Mar 19, 2013 11:28 pm

Thanks Trev:

Unfortunately, knowing, as yet, nothing of Linux, the contents of your web page are at present a mystery to me! My puzzle is: what is the difference between the pre-created user "pi" and a new user with apparently the same properties as "pi" but with differing reaction to a USB storage device. Also, while "pi" has the "Python Games" available from the GUI, the new user doesn't (an important point for grandchild!).

The question, I suppose is: "how do you create a new user identical in all respects (except login name) to "pi"? The command I used was as given in the Raspberry Pi User Guide by Upton & Halfacre, p.36:

sudo useradd -m -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,netdev,input,indiecity username

where the groups were obtained by the groups command when logged in to pi.

(Personal aside to Trev: I see you are in Bristol - my home city is Gloucester, though I've now been in the US for many years.)

David

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: USB drive not recognized for new user

Wed Mar 20, 2013 3:27 pm

david1939 wrote: Unfortunately, knowing, as yet, nothing of Linux, the contents of your web page are at present a mystery to me! My puzzle is: what is the difference between the pre-created user "pi" and a new user with apparently the same properties as "pi" but with differing reaction to a USB storage device. Also, while "pi" has the "Python Games" available from the GUI, the new user doesn't (an important point for grandchild!).
Aha! an easy one. :) The program icons appearing on the desktop (after startx) are the desktop's equivalent of Windows shortcuts. It so happens that user "Pi" has some "pre-defined". A new user has none. To add such, simply left-mouse click on the lower left (swallow-like) icon in the task bar. This will bring a menu (and sub-menus) in which (GUI) program items can be found. Right mouse click will bring up further options including "Add to desktop". NB: By default there are two "desktop windows" (and more can be added).
The question, I suppose is: "how do you create a new user identical in all respects (except login name) to "pi"? The command I used was as given in the Raspberry Pi User Guide by Upton & Halfacre, p.36:

sudo useradd -m -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,netdev,input,indiecity username

where the groups were obtained by the groups command when logged in to pi.
So far so good. An alternative to "groups" is "id" - this gives more info. including the users current (active) group (which can be changed see "newgrp" command). However, for some "groups" to be fully active for the new user that user may have to logout and then re-login and/or a re-boot may be required. This does not need the Pi to be "powered down", just use use this variant of "shutdown":

sudo shutdown -r now

NB: this is best performed from the command-line - not a terminal within the GUI desktop (ie. exit via the lower right "red-button"). The "-r" option implies reboot (-h --> halt).

When I generated the webpages I referred you to the desktop tools of the version of Raspbian I was using then (circa Sept.'12) would not "auto-mount" USB drives "on a mouse click" within the file manager. This was subsequently fixed and certainly worked for user "Pi" (as you already know). I have not tried that method for other users recently (I haven't created other users on most of my Pi's).

Whilst it is true that a user needs to be a member of the "sudo" group to be able to gain (some) root privileges, the exact nature of those privileges depends upon the "sudoers" file which can only be edited via "visudo". Type "apropos sudo" for (pointers to) more info. (IMHO "apropos" is a "most useful" linux command since it can help you find tools you didn't know you had).

I'm going see if I can reproduce your problem - meanwhile can you login (as Pi), plug in the thumb drive and let me know what "ls -laF /media" reports. (This assumes that the drive automounts below the /media directory).
(Personal aside to Trev: I see you are in Bristol - my home city is Gloucester, though I've now been in the US for many years.)
Strictly speaking, we're a mile or so beyond the city boundary so we're in South Gloucestershire. Although my wife is "of 3'rd. generation local stock", I'm from a few miles north of Nottingham, but, having moved here nearly 35yrs. ago no longer need a "passport" :lol: .
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: USB drive not recognized for new user

Wed Mar 20, 2013 7:35 pm

David,
A quick update (and thanks for the PM) - I've been able to reproduce the problem. It looks as if the "fix" to the Raspbian desktop to enable "hotplug" detection and auto-mounting of USB sticks only works for user Pi. It does not seem to matter what groups a new user has been added to (NB: However, I only tried "adm", "cdrom", "sudo" and "users" - being the most likely set based upon my Ubuntu & Fedora linux experience). However, if the new user has sudo-based privileges then, after having created a suitable mount point directory:
eg: "sudo mkdir /media/ThumbDrive"
a standard "mount" command (preceded by "sudo") will mount the USB stick there, and files can then be viewed in the GUI file manager. (NB: Writing to the stick may require permissions to be changed).
The most robust way is to use the fstab file methods referred to previously.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

david1939
Posts: 5
Joined: Sat Mar 16, 2013 11:42 pm
Location: Gloucester Point, VA, USA

Re: USB drive not recognized for new user

Wed Mar 20, 2013 8:02 pm

Thanks for the help. I'll check it out!

Return to “Beginners”