Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
I can not write to my usb drive [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Wed Jun 07, 2017 3:13 am    Post subject: I can not write to my usb drive [solved] Reply with quote

I can't copy files to USB2 or USB3 root or user.
I install a usb3 card recently.
Both USB2 and USB3 work.
I can dd to USB2 and USB3 and USB3 is very fast.


I followed the https://wiki.gentoo.org/wiki/USB/Guide

Please throw me a bone.

Code:

/usr/sbin/lspci -v | grep USB
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller (prog-if 10 [OHCI])
   Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller (prog-if 20 [EHCI])
   Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller (prog-if 10 [OHCI])
   Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller (prog-if 20 [EHCI])
   Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller (prog-if 10 [OHCI])
   Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller (prog-if 10 [OHCI])
   Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller (prog-if 20 [EHCI])
   Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
03:00.0 USB controller: Fresco Logic FL1100 USB 3.0 Host Controller (rev 10) (prog-if 30 [XHCI])
   Subsystem: Fresco Logic FL1100 USB 3.0 Host Controller
ciclo usb #







_________________
Without diversity there can be no evolution:)


Last edited by cwc on Fri Jun 16, 2017 2:59 am; edited 1 time in total
Back to top
View user's profile Send private message
Hieronymus Bosch
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jan 2015
Posts: 75
Location: 31°45′33.14″N 106°29′24.63″W

PostPosted: Wed Jun 07, 2017 4:51 am    Post subject: Reply with quote

Is your user on the usb group?

Can you show us the results of groups command?
_________________
Details fueled any investigation ...
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6972
Location: Saint Amant, Acadiana

PostPosted: Wed Jun 07, 2017 4:54 am    Post subject: Reply with quote

Quote:
I can't copy files to USB2 or USB3 root or user.

Why not?
Is the USB drive mounted?
What is the error of cp command?
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6968

PostPosted: Wed Jun 07, 2017 10:47 am    Post subject: Reply with quote

Jaglover wrote:
Is the USB drive mounted?

and not mount ro
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Wed Jun 07, 2017 11:22 am    Post subject: Reply with quote

Code:
$ groups
tty wheel uucp audio usb users wireshark dialout cwc


and gnome3 mounts the usb drive

From my non-root user:
Code:
$ mount -t  vfat /dev/sdd1 /mnt/usb/
mount: only root can use "--types" option


as root:

Code:
#mount -t  vfat /dev/sdd1 /mnt/usb/

and I can touch file.txt /mnt/usb

[Moderator edit: added [code] tags to preserve output layout. -Hu]
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6972
Location: Saint Amant, Acadiana

PostPosted: Wed Jun 07, 2017 1:20 pm    Post subject: Reply with quote

You can permit user mount in fstab.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42596
Location: 56N 3W

PostPosted: Wed Jun 07, 2017 1:25 pm    Post subject: Reply with quote

cwc,

Code:
-t vfat


vfat does not support *NIX permissions. Somehow, you need to fake the permissions at mount time.
See man mount, the uid= and gid= options.

Its seems like the autoblackmagic in Gnome isn't doing that.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Fri Jun 09, 2017 11:25 am    Post subject: Reply with quote

NeddySeagoon wrote:
cwc,

Code:
-t vfat


vfat does not support *NIX permissions. Somehow, you need to fake the permissions at mount time.
See man mount, the uid= and gid= options.

Its seems like the autoblackmagic in Gnome isn't doing that.


Thanks I'm working on it. "Its seems like the autoblackmagic in Gnome isn't doing that." :) yep

"*nix? . this is a new one to me. Always something to learn.
"A Unix-like (sometimes referred to as UN*X or *nix) "
https://www.nixtips.net/howto-set-nix-file-permissions-using-chmod/


I'm still a noob:

Code:
cwc@ciclo ~ $  id -u cwc
1004
cwc@ciclo ~ $  id -u dude
1005
cwc@ciclo ~ $ id -g cwc
1004
cwc@ciclo ~ $ id -G cwc
1004 5 10 14 18 85 100 999 993
cwc@ciclo ~ $ id cwc
uid=1004(cwc) gid=1004(cwc) groups=1004(cwc),5(tty),10(wheel),14(uucp),18(audio),85(usb),100(users),999(dialout),993(wireshark)
cwc@ciclo ~ $


Thanks!

[Moderator edit: added [code] tags to preserve output layout. -Hu]
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6968

PostPosted: Fri Jun 09, 2017 11:46 am    Post subject: Reply with quote

you need to either put that in fstab, or pass it with -o to mount
user,uid=1004,gid=1004

but it would be better to use gid=100 and add cwc and dude to the group users (that is gid 100)
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Sat Jun 10, 2017 1:25 pm    Post subject: thank you all Reply with quote

Thank you all. I can write to a usb formatted with fat32

It's refreshing to be treated with dignity when asking simple questions.

my
Code:
$groups
tty wheel uucp audio usb users wireshark dialout cwc


Code:
$ getent group
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
tty:x:5:cwc
disk:x:6:root,adm
lp:x:7:lp
mem:x:8:
kmem:x:9:
wheel:x:10:root,craig,cwc
floppy:x:11:root
news:x:13:news
uucp:x:14:uucp,cwc
console:x:17:
audio:x:18:craig,cwc
cdrom:x:19:
tape:x:26:root
video:x:27:root,gdm
cdrw:x:80:
usb:x:85:cwc
users:x:100:craig,cwc
portage:x:250:portage
utmp:x:406:
nogroup:x:65533:
nobody:x:65534:
sshd:x:22:
man:x:15:
input:x:249:
systemd-journal:x:248:
systemd-bus-proxy:x:247:
systemd-journal-gateway:x:246:
systemd-journal-remote:x:245:
systemd-journal-upload:x:244:
systemd-network:x:243:
systemd-resolve:x:242:
systemd-timesync:x:241:
ldap:x:439:
polkitd:x:240:
colord:x:239:
messagebus:x:238:
lpadmin:x:106:
cron:x:16:
crontab:x:105:
locate:x:104:
lock:x:998:
dialout:x:999:craig,cwc
games:x:35:
dhcp:x:103:
plugdev:x:102:craig
apache:x:81:
netdev:x:101:
avahi:x:997:
geoclue:x:996:
gdm:x:995:
craig:x:1001:
ftp:x:21:
mail:x:12:
postmaster:x:994:
nullmail:x:88:
wireshark:x:993:cwc
cwc:x:1004:
mysql:x:60:
dude:x:1005:
openvpn:x:992:
systemd-coredump:x:991:


[Moderator edit: added [code] tags to preserve output layout. -Hu]
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13509

PostPosted: Sat Jun 10, 2017 5:24 pm    Post subject: Reply with quote

Earlier in the thread, someone asked for the output of a command that fails. From your most recent post, it is unclear to me whether the subsequent advice solved your problem or if you still need help. If you need help, please show us a command that fails, starting at the shell prompt, showing the full command you entered, and all output it produces up to the next shell prompt after it fails. For example, I might post:
Code:
$ echo a > /foo
-bash: /foo: Permission denied
$
This shows that my unprivileged user cannot write to a file foo in directory / and that it failed because Permission denied. In this case, that is correct, since / should be unwritable to unprivileged users. In your case, you would use a path that would put the file on the USB drive that you think you should be able to write to. Please also show any relevant lines from /proc/self/mounts so that we can see the filesystem type, mount options, read-only vs read-write status, etc.
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Mon Jun 12, 2017 11:29 am    Post subject: Reply with quote

Hu wrote:
Earlier in the thread, someone asked for the output of a command that fails. From your most recent post, it is unclear to me whether the subsequent advice solved your problem or if you still need help. If you need help, please show us a command that fails, starting at the shell prompt, showing the full command you entered, and all output it produces up to the next shell prompt after it fails. For example, I might post:
Code:
$ echo a > /foo
-bash: /foo: Permission denied
$
This shows that my unprivileged user cannot write to a file foo in directory / and that it failed because Permission denied. In this case, that is correct, since / should be unwritable to unprivileged users. In your case, you would use a path that would put the file on the USB drive that you think you should be able to write to. Please also show any relevant lines from /proc/self/mounts so that we can see the filesystem type, mount options, read-only vs read-write status, etc.



Thanks Hu,
I got distracted with my real job.
I am still working on it with command line.
I can write to a USB stick using the Gnome3 file system.

I can not mount a usb with command line.

Code:

Here are my groups.
$ groups
tty wheel uucp audio usb users wireshark dialout cwc

sudo fdisk -l
Device     Boot Start      End  Sectors  Size Id Type
/dev/sdd1          32 31266815 31266784 14.9G  c W95 FAT32 (LBA)

$ mount -t vfat -ouser,gid=1004 /dev/sdd1 /mnt/usb/
mount: only root can use "--options" option



_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6968

PostPosted: Mon Jun 12, 2017 9:06 pm    Post subject: Reply with quote

You're killing us :)
Code:
su
echo "/dev/sdd1 /mnt/usb auto user,uid=1004,gid=100 0 0" >> /etc/fstab
exit
mount /mnt/usb
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42596
Location: 56N 3W

PostPosted: Tue Jun 13, 2017 10:35 am    Post subject: Reply with quote

krinn,

The auto for the filesystem is scary on a read/write filesystem.
The kernel doesn't often get it wrong but when it does, its a verybadthing.
Still, that's what backups are for.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Fri Jun 16, 2017 2:59 am    Post subject: Reply with quote

krinn wrote:
You're killing us :)
Code:
su
echo "/dev/sdd1 /mnt/usb auto user,uid=1004,gid=100 0 0" >> /etc/fstab
exit
mount /mnt/usb


Thank You!
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum