Page 1 of 2
Root owns all my external usb hard drives everytime I reboot
Posted: 31. Jul 2010, 21:02
by fitus
Hello everybody, I just installed lxde on top of my xfce salix 13.1 install, but now every time I login to xfce or lxde, I get a permission denied when I try to mount all my external usbs drives and when I try to un-mount them , I get an error saying that only root can un-mount them, also every reboot I end up with my external drives mounted on the wrong folders, as example I have created 4 folders on
/media and they used to mount by themselves on the right folders now they mount on different folders, ie. my data hard drive now mounts on the shared folder and my shared drives mounts on my stuffs folder and so on I even uninstalled lxde but still it keeps doing that, the only way for me to get them right is to unplug all the external usb drives and then restart my box and then when I am on the desktop reconnect my drives that is the only way they will auto-mount and mount to the right folders
here is my fstab, I have take a closer look and my fstab changes on every restart don't know why?
Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/sda2 / ext4 noatime,defaults 1 1
/dev/sdj1 /media/Data ntfs-3g defaults,locale=en_US 0 0
/dev/sdk1 /media/Shared ntfs-3g defaults,locale=en_US 0 0
/dev/sdi1 /media/Torrents ntfs-3g defaults,locale=en_US 0 0
/dev/sda3 /media/Ubuntu ext4 defaults 0 0
/dev/sdc1 /media/Virtual ntfs-3g defaults,locale=en_US 0 0
/dev/sda1 /media/Windows_7 ntfs-3g defaults,locale=en_US 0 0
/dev/sdb2 /media/sdb2 ext4 defaults 0 0
/dev/sda4 swap swap defaults 0 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
any help is welcome and I thank you all in advance for all the help given.
Re: Root owns all my external usb hard drives everytime I reboot
Posted: 31. Jul 2010, 21:29
by gapan
Why are you using fstab at all? Don't your drives mount properly when you attach them without any reference in fstab? It should just work. Removable drives should work fine without fstab. And you don't need to create directories in /media, in fact you shouldn't.
The problems you are getting are probably because the hard drives are receiving different device nodes as they are attached and the system detects them in a different order every time. So one specific hard drive might be /dev/sdb one time, but it might become /dev/sdc in next boot. If you insist on using fstab, you should probably switch to using UUIDs and you should also give permissions to mount/umount to your users. But, once more, you shouldn't really use fstab for removable hard drives.
Re: Root owns all my external usb hard drives everytime I reboot
Posted: 31. Jul 2010, 21:47
by fitus
Why are you using fstab at all? Don't your drives mount properly when you attach them without any reference in fstab? It should just work. Removable drives should work fine without fstab. And you don't need to create directories in /media, in fact you shouldn't.
hello gapan, well fstab is on the /etc folder and basically I thought that salix uses it, ( or why is the reason is there ) I have been instructed many times to check fstab, and yes they automount but root owns them, I can not create any file or folder on the drives when I try it says that only root has access to them.
The problems you are getting are probably because the hard drives are receiving different device nodes as they are attached and the system detects them in a different order every time. So one specific hard drive might be /dev/sdb one time, but it might become /dev/sdc in next boot. If you insist on using fstab, you should probably switch to using UUIDs and you should also give permissions to mount/umount to your users. But, once more, you shouldn't really use fstab for removable hard drives.
that is exactly what is happening, they change nodes every time, then what should I do, I moved fstab file to a different location but when I restarted I couldn't get to my salix desktop, I had to use a live cd and put the fstab file back to where it belongs and now it works, I can login to my salix desktop.
what should I do then? should I delete all the 4 folders I created on ( /media )
Thanks. fitus
Re: Root owns all my external usb hard drives everytime I reboot
Posted: 1. Aug 2010, 07:47
by Akuna
fstab is to be used but only for fixed devices. There should be no reason to move it from /etc, otherwise your system will evidently not be able to boot properly.
What you should do is:
1-unmount & unplug your removable devices
2- delete the lines in fstab that deal with your removable devices (make sure you do not accidentally delete any of the other lines or your system won't be able to boot properly afterwards) You should know your mounting scheme & your removable device names. Studying on fstab terminology & configuration options beforehand might be a good idea so you know exactly what you are doing.
3- delete the mounting points (directories) for your removable devices which you created in /media, ensuring that those removable medias have been unmounted as directed in step 1, so as not to delete your data in the process. (again, better to have your removable devices unplugged to be sure)
From then on, your removable devices should be automounted when you plug them with no further ado. And you should be able to unmount them as a regular user.
Re: Root owns all my external usb hard drives everytime I reboot
Posted: 1. Aug 2010, 13:46
by thenktor
Long story short: Don't use fstab for USB drives if you don't know what you are doing!

Re: Root owns all my external usb hard drives everytime I reboot
Posted: 1. Aug 2010, 18:12
by fitus
done, I have done what Akuna has told me and now everything is working as it should, but I have noticed one thing, when I rebooted I checked fstab, just for the heck of it and I saw that fstab has reverted the same way it was before I deleted the lines in fstab that deal with my removable devices, and I deleted it again and rebooted again and fstab has the same lines that I have deleted, so I think fstab re-write itself at every boot.
Fitus
Re: Root owns all my external usb hard drives everytime I reboot
Posted: 1. Aug 2010, 21:11
by Akuna
fitus wrote:I saw that fstab has reverted the same way it was before I deleted the lines in fstab that deal with my removable devices, and I deleted it again and rebooted again and fstab has the same lines that I have deleted, so I think fstab re-write itself at every boot.Fitus
Really? This is odd... could you copy paste the litigious lines please?
Re: Root owns all my external usb hard drives everytime I reboot
Posted: 2. Aug 2010, 05:02
by fitus
sure here it goes, ( this is not the same fstab that I posted first, this is the latest as of 21.51 on sunday 1st of august.
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/sda2 / ext4 noatime,defaults 1 1
/dev/sdj1 /media/Data ntfs-3g defaults,locale=en_US 0 0
/dev/sdk1 /media/Shared ntfs-3g defaults,locale=en_US 0 0
/dev/sdi1 /media/Torrents ntfs-3g defaults,locale=en_US 0 0
/dev/sda3 /media/Ubuntu ext4 defaults 0 0
/dev/sdc1 /media/Virtual ntfs-3g defaults,locale=en_US 0 0
/dev/sda1 /media/Windows_7 ntfs-3g defaults,locale=en_US 0 0
/dev/sdb2 /media/sdb2 ext4 defaults 0 0
/dev/sda4 swap swap defaults 0 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
what is in bold I deleted, which are my usb's drives that are permanently connected to my computer
and this other is
fstab-disk-manager-save, both of them are on the same folder on
/etc, ( this I did not deleted anything form it.
Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/sda2 / ext4 noatime,defaults 1 1
/dev/sdi1 /media/Data ntfs-3g defaults,locale=en_US 0 0
/dev/sdj1 /media/Shared ntfs-3g defaults,locale=en_US 0 0
/dev/sdk1 /media/Shared_ ntfs-3g defaults,nosuid,nodev,uhelper=hal,locale=LC_CTYPE=en_US;LC_NUMERIC=en_US;LC_TIME=en_US;LC_COLLATE=C;LC_MONETARY=en_US;LC_MESSAGES=en_US;LC_PAPER=en_US;LC_NAME=en_US;LC_ADDRESS=en_US;LC_TELEPHONE=en_US;LC_MEASUREMENT=en_US;LC_IDENTIFICATION=en_US 0 0
/dev/sda3 /media/Ubuntu ext4 defaults 0 0
/dev/sdc1 /media/Virtual ntfs-3g defaults,locale=en_US 0 0
/dev/sda1 /media/Windows_7 ntfs-3g defaults,locale=en_US 0 0
/dev/sdb2 /media/sdb2 ext4 defaults 0 0
/dev/sda4 swap swap defaults 0 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
see anything wrong with it ?
Re: Root owns all my external usb hard drives everytime I reboot
Posted: 2. Aug 2010, 13:24
by Akuna
What really is of interest is /etc/fstab as it is the one taken into account by Salix, I suppose that the second file fstab-disk-manager-save is a safeguard copy you made or something?
So are you saying that what was in bold is what you deleted & it came back by itself? That would be very strange if it were so, unless... unless you were not logged in as root when you tried to edit fstab? in which case it simply didn't get modified as of course only root has the power to edit that file.
A simple way to do this from a terminal would be:
then give your administrator (root) password when asked & then:
remove the bold lines & save your file before exiting.
I won't comment on the options but this doesn't look like a regular Salix fstab. Not really a problem as long as it works the way you want it to work.
Re: Root owns all my external usb hard drives everytime I reboot
Posted: 2. Aug 2010, 19:18
by maximus
I am guessing the fstab-disk-manager-save might be something to do with disk-manager, which is a gui software available in the repos that allows you to set up hard drive partitions without manually modifying the fstab. I used it at one point, and seem to remember that it placed an autostart entry for itself in Xfce application autostart, which might be the reason the fstab is being reverted on reboot. If disk-manager was used to add the USB drives to the fstab then this could probably be fixed by running disk-manager again and removing the offending entries, if disk-manager is what is causing the problem that is....