You are not logged in.

#1 2014-06-17 10:10:43

foolius
Member
Registered: 2014-04-02
Posts: 20

[solved] USB Stick read-only

Hi.

I want to install Arch Linux on a USB Stick like described here: https://wiki.archlinux.org/index.php/In … _a_USB_key

I'm doing this on an arch linux machine. But after pacstrap ran successful, the stick is read-only and I can't continue the installation.
I found several things about this on the internet but they were all related to damaged drives or driver problems. I'm using ext4 and fsck says the stick is clean.
Also the permissions for root are rwx.

Any ideas?
Thanks.

Last edited by foolius (2014-06-18 10:05:33)

Offline

#2 2014-06-17 12:56:15

samiam
Banned
From: EAX
Registered: 2010-08-20
Posts: 58

Re: [solved] USB Stick read-only

First suggestion would be to run

mount -o remount,rw /mnt

What is the output of `mount`?

Offline

#3 2014-06-17 15:17:51

foolius
Member
Registered: 2014-04-02
Posts: 20

Re: [solved] USB Stick read-only

samiam wrote:

First suggestion would be to run

mount -o remount,rw /mnt

this changes nothing

What is the output of `mount`?

/dev/sdd1 on /run/media/foo/archstick type ext4 (rw,nosuid,nodev,relatime,uhelper=udisks2)

Offline

#4 2014-06-17 16:59:17

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] USB Stick read-only

Can you mount it somewhere else, like in /mnt/foo or /media/foo ?

Offline

#5 2014-06-17 17:14:05

foolius
Member
Registered: 2014-04-02
Posts: 20

Re: [solved] USB Stick read-only

[foo@arschie ~]$ umount /run/media/foo/archstick/
[foo@arschie ~]$ sudo mount /dev/sdd1 /mnt
[sudo] password for foo: 
[foo@arschie ~]$ sudo genfstab -p /mnt >> /mnt/etc/fstab
bash: /mnt/etc/fstab: Keine Berechtigung
[foo@arschie ~]$ sudo mount -o remount,rw /mnt
[foo@arschie ~]$ sudo genfstab -p /mnt >> /mnt/etc/fstab
bash: /mnt/etc/fstab: Keine Berechtigung

Offline

#6 2014-06-17 17:19:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] USB Stick read-only

Run

LC_ALL=C <command>

to get the output in English.

Offline

#7 2014-06-17 17:36:14

foolius
Member
Registered: 2014-04-02
Posts: 20

Re: [solved] USB Stick read-only

Ah, sorry it basically says "No permission"

[foo@arschie ~]$ LC _ALL=C sudo genfstab -p /mnt >> /mnt/etc/fstab
bash: /mnt/etc/fstab: Keine Berechtigung

I'm doing it wrong, I think.

Offline

#8 2014-06-17 18:09:21

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved] USB Stick read-only

Get rid of the space between LC and _ALL:

$ LC _ALL=C sudo genfstab -p /mnt >> /mnt/etc/fstab #wrong
$ LC_ALL=C sudo genfstab -p /mnt >> /mnt/etc/fstab #right

But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#9 2014-06-17 18:31:49

foolius
Member
Registered: 2014-04-02
Posts: 20

Re: [solved] USB Stick read-only

$ LC_ALL=C sudo genfstab -p /run/media/foo/archstick/ >> /run/media/foo/archstick/etc/fstab
bash: /run/media/foo/archstick/etc/fstab: Keine Berechtigung

Still not working sad

Offline

#10 2014-06-17 18:54:29

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [solved] USB Stick read-only

Aah, crap. I don't know why LC_ALL isn't working, but you're getting the permission error because sudo has no effect on redirection.

You have to do

genfstab -p /run/media/foo/archstick/ | sudo tee -a /run/media/foo/archstick/etc/fstab >/dev/null

Oops, I think it needs to be after sudo:

$ sudo LC_ALL=C genfstab -p /run/media/foo/archstick/ >> /run/media/foo/archstick/etc/fstab

Maybe not.  Iin my case having LC_ALL before sudo seemed to work fine...

Last edited by alphaniner (2014-06-17 19:05:48)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#11 2014-06-17 19:07:28

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [solved] USB Stick read-only

Note “sudo” only applies to the command, and not the IO redirection. So the creation of the “/mnt/etc/fstab” will be as your uid, not root's which is why you get a permission error

Use 1 of the following to resolve this:

sudo bash -c 'genfstab -p /mnt >> /mnt/etc/fstab'
genfstab -p /mnt | sudo tee -a /mnt/etc/fstab

Edit: too slow - alphaniner beat me to it smile

Last edited by ukhippo (2014-06-17 19:09:21)

Offline

#12 2014-06-17 19:20:25

foolius
Member
Registered: 2014-04-02
Posts: 20

Re: [solved] USB Stick read-only

ok, thank you very much, I was not able to change the language, but the permission works now smile

It was like a facepalm when I understood the problem.

Offline

#13 2014-06-17 22:10:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] USB Stick read-only

It's best to simplify the issue as far as you can to find out where exactly the problem lies. You can try creating a file on the stick with e.g. 'sudo touch /mnt/foo', and if that works just fine, it means that the problem is with a creating the file in a specific way.
I wanted to suggest it earlier, but the forum kept crashing when I tired to edit my post :-(


Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

Offline

Board footer

Powered by FluxBB