fredca
Posts: 40
Joined: Tue Oct 16, 2012 12:14 pm

mount usbstick

Wed Apr 08, 2015 11:46 am

I have just recieved a rpi 2 and installed the latest noobs, raspbian, I try to mount a usb stick with this in /etc/fstab
/dev/sda1 /media/FREDSTICK vfat rw,auto,users 0 0
But it mounts as read only and when I try to mount manually I get /dev/sda1 is a read only filing system
How can I boot with this device rw for everyone?

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

Re: mount usbstick

Wed Apr 08, 2015 1:47 pm

fredca wrote:I have just recieved a rpi 2 and installed the latest noobs, raspbian, I try to mount a usb stick with this in /etc/fstab
/dev/sda1 /media/FREDSTICK vfat rw,auto,users 0 0
But it mounts as read only and when I try to mount manually I get /dev/sda1 is a read only filing system
How can I boot with this device rw for everyone?
IIRC you need to add the directory and file (dmask and fmask) permissions in a somewhat similar way to what I discuss here:
http://www.cpmspectrepi.webspace.virgin ... ticks.html
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

fredca
Posts: 40
Joined: Tue Oct 16, 2012 12:14 pm

Re: mount usbstick

Thu Apr 09, 2015 8:50 am

Hi FTrevorGowen
this is not the problem, somehow /dev/sda1 is a Read only Filesystem
see
pi@raspberrypi ~ $ get_iplayer --get 463
get_iplayer 2.92-ppa22, Copyright (C) 2008-2010 Phil Lewis
This program comes with ABSOLUTELY NO WARRANTY; for details use --warranty.
This is free software, and you are welcome to redistribute it under certain
conditions; use --conditions for details.

Matches:
463: EastEnders - 07/04/2015, BBC One, Audio Described,Drama,Soaps, default,audiodescribed

INFO: 1 Matching Programmes
INFO: Using 'original' version (b05qp529) as 'default'
INFO: Checking existence of default version
INFO: flashvhigh1,flashvhigh2,flashhigh1,flashhigh2,flashstd1,flashstd2,flashlow1,flashlow2 modes will be tried for version default
INFO: Trying flashvhigh1 mode to record tv: EastEnders - 5046. 07/04/2015
INFO: File name prefix = EastEnders_-_5046._07_04_2015_b05qp53g_default
ERROR: Could not create dir '/media/FREDSTICK/Player/TV/EastEnders-1': mkdir /media/FREDSTICK/Player/TV/EastEnders-1: Read-only file system at /usr/bin/get_iplayer line 4310



pi@raspberrypi ~ $ ls -lsa /media/
total 17
4 drwxr-xr-x 4 root root 4096 Apr 9 09:35 .
4 drwxr-xr-x 22 root root 4096 Jan 1 1970 ..
8 drwxr-xr-x 4 pi root 8192 Jan 1 1970 FREDSTICK
1 drwxr-xr-x 3 root root 1024 Jan 1 1970 SETTINGS
pi@raspberrypi ~ $

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: mount usbstick

Thu Apr 09, 2015 9:39 am

Is the stick formatted as NTFS? If so, you will need to" sudo apt-get install ntfs-3g" to be able to write to it.

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

Re: mount usbstick

Thu Apr 09, 2015 11:01 am

fredca wrote:Hi FTrevorGowen
this is not the problem, somehow /dev/sda1 is a Read only Filesystem
...
pi@raspberrypi ~ $ ls -lsa /media/
total 17
4 drwxr-xr-x 4 root root 4096 Apr 9 09:35 .
4 drwxr-xr-x 22 root root 4096 Jan 1 1970 ..
8 drwxr-xr-x 4 pi root 8192 Jan 1 1970 FREDSTICK
1 drwxr-xr-x 3 root root 1024 Jan 1 1970 SETTINGS
pi@raspberrypi ~ $
There still seems to a permissions problem - group and all access to /media/FREDSTICK are read only! Have you (pre-)created the necessary FREDSTICK subdirectories? What do you see if (as user pi) you cd to /media/FREDSTICK and run ls -laF?
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

fredca
Posts: 40
Joined: Tue Oct 16, 2012 12:14 pm

Re: mount usbstick

Thu Apr 09, 2015 1:36 pm

Hi thanks for the response, the article was very interesting and would have saved me a lot of time if I had read it before starting this project! such is life.
back to the subject

Code: Select all

pi@raspberrypi /media/FREDSTICK $ ls -laF
total 36
drwxr-xr-x 4 root root 8192 Jan  1  1970 ./
drwxr-xr-x 4 root root 4096 Apr  9 09:52 ../
-rwxr-xr-x 1 root root  294 Nov 29 08:49 .get_iplayercrontab*
drwxr-xr-x 0 root root 8192 Mar  8  2014 Player/
drwxr-xr-x 4 root root 8192 Apr  4 11:17 .Trash-1000/
it's mounted as owner root and user root as it was mounted at boot, fstab entry is

Code: Select all

pi@raspberrypi /media/FREDSTICK $ cat /etc/fstab
proc            /proc           proc    defaults          0	0
/dev/mmcblk0p5  /boot           vfat    defaults          0	2
/dev/mmcblk0p6  /               ext4    defaults,noatime  0	1
#/dev/sda1	/media/FREDSTICK   auto   rw,auto,user   0	0
/dev/sda1	/media/FREDSTICK  vfat	rw,auto,users	0	0 
# a swapfile is not a swap partition, so no using swapon|off from here on, use  dphys-swapfile swap[on|off]  for that
pi@raspberrypi /media/FREDSTICK $ 
If I umount it and mount it as pi the ownership changes but I still can't write to it I get "/dev/sda1 is aq read only file system"

fredca
Posts: 40
Joined: Tue Oct 16, 2012 12:14 pm

Re: mount usbstick

Thu Apr 09, 2015 1:43 pm

gparted doesn't see the stick, mount returns

Code: Select all

pi@raspberrypi /media/FREDSTICK $ mount
/dev/root on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=470368k,nr_inodes=117592,mode=755)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=94936k,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=189860k)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/mmcblk0p5 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sda1 on /media/FREDSTICK type vfat (ro,nosuid,nodev,noexec,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p3 on /media/SETTINGS type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
pi@raspberrypi /media/FREDSTICK $ 
I originally formatte3d to FAT32 as a more or less universal format
Im taking the device out to run gparted on another machine, this will require a reboot
Acording to gparted on Ubuntu it's formatted fat32

I'm trying to set this drive so that after boot it's available to all, or as you prefer most, users and I can see why all is not good.
So I'm going to have to set up UID, GID and masks. In the meantime I was trying to get it working as pi. The problems I've encountered sugest this has something to do with the mount process rather than fstab settings hence this post.
Perhaps I should close this post and try to do the whole job and open a new post if need be?

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: mount usbstick

Thu Apr 09, 2015 2:15 pm

Unless you need to share this USB stick with Windows systems, I would reformat it as ext4. (Warning: all existing data on the stick would be destroyed). You avoid a whole load of permissions and ownership issues.
Unix engineer since 1989

fredca
Posts: 40
Joined: Tue Oct 16, 2012 12:14 pm

Re: mount usbstick

Fri Apr 10, 2015 9:20 am

Hi cpc464
That sounbds like a very very good idea. I need to shre the results with windows, perhaps, but that can be achieved with a post process copy to a fat32 stick.
Ta,
I was using Xenix in 83

fredca
Posts: 40
Joined: Tue Oct 16, 2012 12:14 pm

Re: mount usbstick

Fri Apr 10, 2015 9:47 am

well this shows the problem. The following is the error report from Gparted when I tried to format it ext4

GParted 0.12.1 --enable-libparted-dmraid
Libparted 2.3
Format /dev/sda1 as ext4  00:00:06    ( ERROR )
calibrate / e / da1  00:00:00    ( SUCCESS )
path: /dev/sda1
start: 32
end: 31,266,815
size: 31,266,784 (14.91 GiB)
set partition type on / e / da1  00:00:06    ( SUCCESS )  
new partition type: ext4
create new ext4 file system  00:00:00    ( ERROR )
mkfs.ext4 -j -O extent -L "" /dev/sda1
mke2fs 1.42.5 (29-Jul-2012)
/dev/sda1: Read-only file system while setting up superblock
libparted messages    ( INFO )
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only.
Can't write to /dev/sda, because it is opened read-only.
Unable to open /dev/sda read-write (Read-only file system). /dev/sda has been opened read-only

It seems to be something wrong with the installation?

fredca
Posts: 40
Joined: Tue Oct 16, 2012 12:14 pm

Re: mount usbstick

Fri Apr 10, 2015 11:33 am

I've re-installed raspbian and nothing has changed.

fredca
Posts: 40
Joined: Tue Oct 16, 2012 12:14 pm

Re: mount usbstick

Tue Apr 14, 2015 10:43 am

well I tried to use on my PC with Ubuntu and the stick is red-only! nothing seems to correct it.
Anyway this is the wrong forum for this
Is there a way to close this?

Return to “Beginners”