Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had some problems with the /dev/sda5 partition, so I was advised to mount it as read only.
The thing is that now I've being trying to mount it back to normal (writable), but I'm not being able.
The fstab output is this one:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda2 during installation
UUID=b08baef3-c005-4070-aa15-227d73102c66 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda3 during installation
UUID=dbd1d13b-a045-4029-8192-59f96a968680 /home ext4 defaults 0 2
# /media/datos was on /dev/sda5 during installation
UUID=9c407492-2dcf-4641-b411-328633ccdd2d /media/datos ext4 defaults 0 2
# swap was on /dev/sda1 during installation
UUID=1440874c-35b7-4dbd-9318-1fa3fc408f45 none swap sw 0 0
I don't know what to do. I've seen a lots of post dealing with the "errors=remount-ro 0 1" problem, but I just don't know how to aply them to my case. Can I just manually modify the fstab file? Should it be correct?
Isn't this a matter of permissions? The setting in /etc/fstab does not prevent mountin as writable.
Have you tried writing to /media/datos as root?
Please ost output of "ls -l /media/datos".
Also unmount /dev/sda5, sceck permissions again, try writing again.
You could also check with "lsattr /media"
@cruzdelsur: The fstab entry shown for sda5 looks ok (assuming the UUID is correct, check it with the blkid command).
Quote:
Originally Posted by cruzdelsur
I had some problems with the /dev/sda5 partition, so I was advised to mount it as read only.
The thing is that now I've being trying to mount it back to normal (writable), but I'm not being able.
Can you tell us a bit more about the actual problem? The above doesn't help much.
- Are you able to mount and unmaount /dev/sda5 manually (as root)?
- If you are able to mount it, are you able to write to it as root and normal user?
- What is the output of ls -l /media (when sda5 not mountes and when sda5 is mounted)
- What is the output of mount (after mounting sda5).
In fedora /media is a tmpfs filesystem, so on every boot it starts out empty. The fstab mounts require that the mount point exist before mounting, so it is recommended to put such mounts in /mnt, or where ever you have designated the mount point (as long as it isn't a tmpfs filesystem).
Thanks all for your help. I'll try to reply to all of your questions.
@Pingu and @ruuna
I can access the partition as me and as root, but I got different views of it:
This is what I see as normal user: http://bit.ly/ZcEMNq
This is what it should be (and what I see as root): http://bit.ly/XATv6L
I've tried to change the permissions to the /dev/sda5 but I was not able. I copied the files to /home (as root), and then I changed the permissions there (chmod R -777). They seem to change, however, the folder containing the files, don't change. It bothers me, because if I want to modify them, I have to save them somewhere else, because the folder is blocked
@Pingu
Quote:
Have you tried writing to /media/datos as root?
Yes, I can write to /media/datos as root.
Output of "ls -l /media/datos:
Code:
-l /media/datos
ls: no se puede acceder a /media/datos/PDF: Permiso denegado
ls: no se puede acceder a /media/datos/morfologia.tar: Permiso denegado
ls: no se puede acceder a /media/datos/imagenes: Permiso denegado
ls: no se puede acceder a /media/datos/ingles: Permiso denegado
ls: no se puede acceder a /media/datos/lista podcasts.opml: Permiso denegado
ls: no se puede acceder a /media/datos/varios: Permiso denegado
ls: no se puede acceder a /media/datos/copia.vdi: Permiso denegado
ls: no se puede acceder a /media/datos/GIM: Permiso denegado
ls: no se puede acceder a /media/datos/VEGANIA: Permiso denegado
ls: no se puede acceder a /media/datos/winshared: Permiso denegado
ls: no se puede acceder a /media/datos/Flyer: Permiso denegado
ls: no se puede acceder a /media/datos/lista podcasts.opml~: Permiso denegado
ls: no se puede acceder a /media/datos/audios ordenar: Permiso denegado
ls: no se puede acceder a /media/datos/Music: Permiso denegado
ls: no se puede acceder a /media/datos/pdfs ordenars: Permiso denegado
ls: no se puede acceder a /media/datos/tipografias: Permiso denegado
ls: no se puede acceder a /media/datos/Coursera: Permiso denegado
ls: no se puede acceder a /media/datos/morfologia.tar.gz: Permiso denegado
ls: no se puede acceder a /media/datos/genetica.tar.gz: Permiso denegado
ls: no se puede acceder a /media/datos/TEMP: Permiso denegado
ls: no se puede acceder a /media/datos/otros ordenar: Permiso denegado
ls: no se puede acceder a /media/datos/arte: Permiso denegado
ls: no se puede acceder a /media/datos/zeitgeist: Permiso denegado
ls: no se puede acceder a /media/datos/lost+found: Permiso denegado
total 0
d????????? ? ? ? ? ? arte
d????????? ? ? ? ? ? audios ordenar
-????????? ? ? ? ? ? copia.vdi
d????????? ? ? ? ? ? Coursera
d????????? ? ? ? ? ? Flyer
-????????? ? ? ? ? ? genetica.tar.gz
d????????? ? ? ? ? ? GIM
d????????? ? ? ? ? ? imagenes
d????????? ? ? ? ? ? ingles
-????????? ? ? ? ? ? lista podcasts.opml
-????????? ? ? ? ? ? lista podcasts.opml~
d????????? ? ? ? ? ? lost+found
-????????? ? ? ? ? ? morfologia.tar
-????????? ? ? ? ? ? morfologia.tar.gz
d????????? ? ? ? ? ? Music
d????????? ? ? ? ? ? otros ordenar
d????????? ? ? ? ? ? PDF
d????????? ? ? ? ? ? pdfs ordenars
d????????? ? ? ? ? ? TEMP
d????????? ? ? ? ? ? tipografias
d????????? ? ? ? ? ? varios
d????????? ? ? ? ? ? VEGANIA
d????????? ? ? ? ? ? winshared
d????????? ? ? ? ? ? zeitgeist
lsattr /media:
Code:
--------------- /media/datos
@Pingu
Quote:
Also unmount /dev/sda5, sceck permissions again, try writing again.
I'll try this later, gotta go now!
@druuna Yes, the UUID is correct, just checked. I'll reply to your other questions later, I have to go!!!
@jpollard I'm using Ubuntu 12.04. However, thanks for that information, it's quite useful since I'm planning to move to Fedora as soon as I fix this partition so I can backup that info!!
So your user simply doesn't have permissisons to the files.
What you do is:
#chown -R <username> /media/datos/
Also, I agree with jpollard: Don't mount it under /media, change it to /mnt/datos.
It's not only Fedora that uses /media that way, what I've seen is that more and more distros do that.
So let the system keep /media for it's own use, mount your own stuff somewhere else.
Sorry, I've been really busy, I haven't had time to reply or do the other things you requested me.
I can only say to @pingu that I tried chown -R but it didn't work. I think it's related to the errors=remount-ro 0 1 that it's shown in fstab.
I'll mount it in /mnt/datos next time then.
Thanks! I'll finish replying tomorrow!
Make sure the directory /mnt/datos has right ownership before mounting!
And that " errors=remount-ro 0 1 that it's shown in fstab." is for / not for /media/datos.
-Have you tried writing to /media/datos as root?
- What is the output of mount (after mounting sda5).
So, I thought I could write to /media/datos, but I cannot! I tried to open one file and I couldn't.
Here is the output of mount (after mounting sd5):
Code:
/dev/sda2 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
/dev/sda3 on /home type ext4 (rw)
/dev/sda5 on /media/datos type ext4 (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/cheluna/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=cheluna)
@druuna
Quote:
- Are you able to mount and unmaount /dev/sda5 manually (as root)?
- If you are able to mount it, are you able to write to it as root and normal user?
- What is the output of ls -l /media (when sda5 not mountes and when sda5 is mounted)
- What is the output of mount (after mounting sda5).
-Yes, I'm able to mount/unmonunt /dev/sd5 as root.
-I'm not able to write, not even as root.
ls -l
total total 14208496
dr--r--r-- 3 cheluna cheluna 4096 may 14 2012 arte
dr--r--r-- 10 cheluna cheluna 12288 feb 10 22:42 audios ordenar
-rw-rw-r-- 1 cheluna cheluna 10725928960 feb 10 03:39 copia.vdi
dr--r--r-- 2 cheluna cheluna 4096 feb 10 03:41 Coursera
dr--r--r-- 2 cheluna cheluna 4096 dic 2 10:52 Flyer
-rw-rw-r-- 1 cheluna cheluna 2975014484 may 15 2012 genetica.tar.gz
dr--r--r-- 2 cheluna cheluna 12288 ene 22 12:06 GIM
dr--r--r-- 24 cheluna cheluna 20480 feb 10 22:40 imagenes
dr--r--r-- 3 cheluna cheluna 12288 oct 9 12:42 ingles
-rw-rw-r-- 1 cheluna cheluna 9084 feb 10 23:21 lista podcasts.opml
-rw-rw-r-- 1 cheluna cheluna 8823 feb 10 23:21 lista podcasts.opml~
dr--r--r-- 2 cheluna root 4096 jun 10 2012 lost+found
-rw-rw-r-- 1 cheluna cheluna 10240 may 15 2012 morfologia.tar
-rw-rw-r-- 1 cheluna cheluna 848288533 may 15 2012 morfologia.tar.gz
dr--r--r-- 88 cheluna cheluna 4096 mar 11 19:56 Music
dr--r--r-- 16 cheluna cheluna 20480 mar 11 18:14 otros ordenar
dr--r--r-- 5 cheluna cheluna 4096 feb 10 22:45 PDF
dr--r--r-- 2 cheluna cheluna 49152 feb 16 14:48 pdfs ordenars
dr--r--r-- 3 cheluna cheluna 20480 feb 10 22:05 TEMP
dr--r--r-- 2 cheluna cheluna 4096 feb 10 03:41 tipografias
dr--r--r-- 3 cheluna cheluna 12288 mar 11 18:41 varios
dr--r--r-- 15 cheluna cheluna 4096 ene 11 03:16 VEGANIA
dr--r--r-- 21 cheluna cheluna 20480 ene 30 17:01 winshared
dr--r--r-- 4 cheluna cheluna 4096 dic 25 22:39 zeitgeist
ls -l with sd5 mounted:
Code:
cheluna@cheluna-Aspire-5734Z:~$ ls -l /media/datos
ls: no se puede acceder a /media/datos/PDF: Permiso denegado
ls: no se puede acceder a /media/datos/morfologia.tar: Permiso denegado
ls: no se puede acceder a /media/datos/imagenes: Permiso denegado
ls: no se puede acceder a /media/datos/ingles: Permiso denegado
ls: no se puede acceder a /media/datos/lista podcasts.opml: Permiso denegado
ls: no se puede acceder a /media/datos/varios: Permiso denegado
ls: no se puede acceder a /media/datos/copia.vdi: Permiso denegado
ls: no se puede acceder a /media/datos/GIM: Permiso denegado
ls: no se puede acceder a /media/datos/VEGANIA: Permiso denegado
ls: no se puede acceder a /media/datos/winshared: Permiso denegado
ls: no se puede acceder a /media/datos/Flyer: Permiso denegado
ls: no se puede acceder a /media/datos/lista podcasts.opml~: Permiso denegado
ls: no se puede acceder a /media/datos/audios ordenar: Permiso denegado
ls: no se puede acceder a /media/datos/Music: Permiso denegado
ls: no se puede acceder a /media/datos/pdfs ordenars: Permiso denegado
ls: no se puede acceder a /media/datos/tipografias: Permiso denegado
ls: no se puede acceder a /media/datos/Coursera: Permiso denegado
ls: no se puede acceder a /media/datos/morfologia.tar.gz: Permiso denegado
ls: no se puede acceder a /media/datos/genetica.tar.gz: Permiso denegado
ls: no se puede acceder a /media/datos/TEMP: Permiso denegado
ls: no se puede acceder a /media/datos/otros ordenar: Permiso denegado
ls: no se puede acceder a /media/datos/arte: Permiso denegado
ls: no se puede acceder a /media/datos/zeitgeist: Permiso denegado
ls: no se puede acceder a /media/datos/lost+found: Permiso denegado
total 0
d????????? ? ? ? ? ? arte
d????????? ? ? ? ? ? audios ordenar
-????????? ? ? ? ? ? copia.vdi
d????????? ? ? ? ? ? Coursera
d????????? ? ? ? ? ? Flyer
-????????? ? ? ? ? ? genetica.tar.gz
d????????? ? ? ? ? ? GIM
d????????? ? ? ? ? ? imagenes
d????????? ? ? ? ? ? ingles
-????????? ? ? ? ? ? lista podcasts.opml
-????????? ? ? ? ? ? lista podcasts.opml~
d????????? ? ? ? ? ? lost+found
-????????? ? ? ? ? ? morfologia.tar
-????????? ? ? ? ? ? morfologia.tar.gz
d????????? ? ? ? ? ? Music
d????????? ? ? ? ? ? otros ordenar
d????????? ? ? ? ? ? PDF
d????????? ? ? ? ? ? pdfs ordenars
d????????? ? ? ? ? ? TEMP
d????????? ? ? ? ? ? tipografias
d????????? ? ? ? ? ? varios
d????????? ? ? ? ? ? VEGANIA
d????????? ? ? ? ? ? winshared
d????????? ? ? ? ? ? zeitgeist
-See above for the output of mount, please.
I hope this is helpful. Thank you so much!!
Last edited by cruzdelsur; 03-12-2013 at 11:06 AM.
The output of "ls -l" is the same with sda5 mounted & unmounted.
Well, there's nothing really wrong with that - apart from waste of space. Or do you consider it as a backup?
Now let's do this carefully and in good order.
1) Can you write to /media/datos - first you said you could as root, now you say you can't (after trying to open a file, not writing)?
And how did you open the file with a blank in the filename?
Try with & without /dev/sda5 mounted, try as user and as root.
So that's four commands, do it in a very failsafe way:
I've tried to change the permissions to the /dev/sda5 but I was not able. I copied the files to /home (as root), and then I changed the permissions there (chmod R -777). They seem to change, however, the folder containing the files, don't change. It bothers me, because if I want to modify them, I have to save them somewhere else, because the folder is blocked
Is what I put in bold a typo? It should be "chmod -R 777 /home/datos" (or whatever directory).
However, it's a bad idea to use 777 - I realize it's just for testing, but the risk is you forget to change that and then you have lots of world-writable files in your system which is a security risk.
Better change ownership to yourself:
# chown -R cheluna:cheluna /home/datos/
Last edited by pingu; 03-11-2013 at 02:54 PM.
Reason: Spelling
Hi Pingu, thanks for your time and patience!!
I was answering your questions, but then something came to my mind. Does it matter when I do these tests (touch /media/datos/Documentos/atest) that I don't have a folder named Documentos?? do I have to replace with one file I know I have? Or it doesn't matter?
Last edited by cruzdelsur; 03-11-2013 at 04:39 PM.
Well, yeah, I put some backup there. I just wanted to say it wasn't my idea to create the /media/datos partition, I saw it somewhere else and it had worked great for a couple of years... But that's not relevant now.
1) Well... let's see... this is quite strange (to me). I told before I could write to /media/datos because I remembered I opened some txt files and save them without problems (as root). Today, when I was replying to you, I checked again, and tried to open a pdf file, and I couldn't open it!! So, I thought I couldn't. My mistake, I should have checked the text file again. Then, I checked again, and guess what happened: I can open/write txt, jpg, zip and png files, but I cannot open pdf, odt, ods, pptx (these are the ones I checked now). So strange.
I didn't opened the file with blank in the filename, I just copy/paste one of the multiple errors that the terminal showed.
Ok, the fun part
I used the folder Music instead of Documentos (because I don't have a Documentos folder there).
Is what I put in bold a typo? It should be "chmod -R 777 /home/datos" (or whatever directory).
I used the directory when I changed the permissions, I just didn't write the whole "phrase" here, I thought it wasn't very important. I thoutht the important part was the command I used. However, I'll remember to change the permission back, thanks for the warning.
I tried to change the permission to /home, is this correct?
# chown -R cheluna:cheluna /home/
and this happens:
Code:
sudo chown -R cheluna:cheluna /home/
chown: no se puede acceder a «/home/cheluna/.gvfs»: Permiso denegado.
Anyways, I think I can live with that, because now the folders in home (the ones I copied before from /dev/sda5) are not protected anymore. I think I'll copy the remaining folders from /dev/sda5 to home, change the permissions and backup somewhere else later. Then, I'll format again that partition!! I guess it must be done!
About the point number 1), I was thinking... could it be related that I used the Photorec and I tried to restore only some formats? Don't know, just wondering...
Thanks you Pingu!! Let me know what you think please!
Now I really wonder what's going on, I'm very confused!
Quote:
I used the folder Music instead of Documentos (because I don't have a Documentos folder there).
BUT! drwxr-xr-x 3 cheluna cheluna 4096 mar 8 03:30 Documentos
That is a directory and owned by cheluna. "Music" does not exist - but you can write to Music as root???
Are you by any chance mixing up directories? Easily done when you've struggled with a problem for a while.
One thing, when you checked the mountpoints before that "touch..." exercise, you have /dev/sda5 mounted twice.
Make sure it's just mounted in one place.
This doesn't solve anything, you can mount a partition in two places but we need everything to be failsafe here.
I'm going to read through your earlier thread, and see if I can come up with something.
BBL!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.