You are not logged in.
Pages: 1
Topic closed
I'm doing a new install on a USB. I got to the point in the installation guide where the next step is to generate an fstab table. The results were:
[ross@Lenovo3Part ~]$ sudo genfstab -U /mnt >> /mnt/etc/fstab
bash: /mnt/etc/fstab: Permission denied
I futzed around a bit with no success and finally just did
[ross@Lenovo3Part ~]$ su root
Password:
[root@Lenovo3Part ross]# genfstab -U /mnt >> /mnt/etc/fstab
[root@Lenovo3Part ross]# exit
Which did the trick, I think. I mean I now have a fstab on /mnt/etc/ and it looks as though all the UUIDs are correct etc. but I would like to know went wrong (or what I was doing wrong) in the first instance. I'm going to take a break in the installation process just in case whatever caused this will have other effects later.
Last edited by WeeDram (2016-12-02 00:52:50)
Offline
You need root access to write to that file or create it in that directory. The first time you ran it, you were not writing as root. You ran genfstab as root (which technically probably isn't really necessary) but attempted to write the file as a normal user.
This is a commonly misunderstood caveat of shell redirection. To run this command from a normal user shell you would need to use tee:
$ genfstab -U /mnt | sudo tee /mnt/etc/fstab
See also: wiki
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Wow! You are so quick I didn't have enough time to take that break. Thank you very much. I can see how that is the case. I used the command as presented in the installation guide and, I guess, just assumed the sudo (implied by the #) carried right through the whole command. Learned something today.
Thanks again.
Offline
just assumed the sudo (implied by the #)
No, the # indicates that you are running the command as root, not using sudo; there is a difference, as you have learned.
Offline
More clarification! Thank you.
Offline
And if for some strange reason tee just rubs you the wrong way then you can always run the whole command as posted in the wiki using sudo. But the proper way to do that would be:
sudo bash -c 'genfstab -U /mnt > /mnt/etc/fstab'
Since the whole thing, redirection and all, is taking place in a bash subshell running as root, the bash redirection is of course powered by root and succeeds.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
that should be in official install guide wiki
you just can't image how it's frustrating when guide is crap and simply not working.....
Offline
that should be in official install guide wiki
you just can't image how it's frustrating when guide is crap and simply not working.....
Not nearly as frustrating as a four year necrobump with nothing but a petulant whine: https://wiki.archlinux.org/index.php/Co … bumping.22
Offline
Also for the most part the installation guide assumes you are root, and as shown in this thread is actually indicated.
Closing.
Offline
Pages: 1
Topic closed