LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   mounting issues (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-issues-550549/)

gawdin 05-01-2007 11:49 PM

mounting issues
 
I have two computers running SUSE Linux 10 (one is 10.1 the other is enterprise desktop 10)

SL 10.1= external devices appear on Gnome desktop but wont mount with the error /dev/sda1 found in /etc/fstab and wont let me view contents

SLED 10=doesn't see the device at all

any ideas how to fix this?
thanks for any help

Sting2001 05-02-2007 12:05 AM

Mounting storage
 
Hi

You need to be root or authorized group user to change /etc/fstab or to mount a volume. Make sure "user" option is in the /dev/sda1. If this is flash storage as I suspect have a look at the dmesg output after you plug in the flash drive. The automounting of flash memory is imperfect at best and you may need to unmount the storage from the command line to avoid corruption and data loss. Otherwise read the man page for mount and resubmit to [opensuse] list.

Have fun,

Stephen

gawdin 05-02-2007 09:31 PM

how do I add a make it so I can edit fstab? or how do I get it so that my flash memory auto mounts? I don't know anything really about linux yet and I would be thankful for any help.

jludwig 05-02-2007 09:38 PM

I don't use flash memory, but, with the new udev?? setup when you edit fstab you need to make it immutable so it is not overwritten the next time you reboot.

From the command line, as root;
[root@localhost ~]# chattr +i /etc/fstab

gawdin 05-02-2007 09:55 PM

:confused: :newbie: um that made no sense, I am sorry.

what I want I think is to know how to edit fstab to automount but I need root privs to do so and I don't know how to give my user prof the access to edit it

jschiwal 05-02-2007 10:23 PM

You could use the "halmount" program as a normal user to try to mount the device.

I don't remember if SuSE 10.0 is much different. On SuSE 10.2, if the drive has an entry in /etc/fstab, then udev should honor it. You do want to write your /etc/fstab entry so that you can mount the drive even if you are assigned a different device the next time you plug it in.

You could use the UUID number in the /etc/fstab entry. To find that out, I would recommend using the "udevinfo" program. I will use an external drive on my machine to walk you though the process with a real example:
Code:

udevinfo -q env -n /dev/sdb2
ID_SERIAL=0090a99200000270:1:1
ID_BUS=ieee1394
ID_PATH=pci-0000:02:00.0-ieee1394-0x0090a99200000270:1:1
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=3da4cc2e-80bd-4c03-94e8-fe25e4b64178
ID_FS_LABEL=
ID_FS_LABEL_SAFE=

Now add an entry in /etc/fstab using the UUID instead of the device:
Code:

UUID=3da4cc2e-80bd-4c03-94e8-fe25e4b64178      /media/lbigdisk        ext3    acl,user_xattr,noauto,user      0 0
Note the "noauto" and "user" option. This fstab entry would allow you to enter "mount /media/lbigdisk" to mount the drive even without using UDEV. The "noauto" entry prevents the drive from being mounted with "mount -a" which happens when you boot. This would cause a problem if the device wasn't plugged in when you booted.
The "user" entry allows the user to mount the drive without needing to su to root. Now if I plugged the drive into a different port, and it was assigned /dev/sdc2 instead, there wouldn't be a problem.

HAL uses helper programs, including a KDE or Gnome service to bring up a requester if you plug in the drive when running in your Window Manager session, but I don't use gnome so I can't help with that part. (note: Other distro's use hotplug instead)

For memory cards and pendrives with fat32 filesystems, you might consider using using the "mlabel" program to label the device. I have an SD card that I labeled "Podcasts". When I plug it in, it automounts under /media/PODCASTS without having an entry in /etc/fstab. The mlabel program is supplied by the mtools program.
I needed to add this entry before the device was assigned a DOS device letter:
Code:

# added for sandisk
drive e: file="/dev/sdc1"

Code:

udevinfo -q env -n /dev/sdc1
ID_VENDOR=Generic
ID_MODEL=STORAGE_DEVICE
ID_REVISION=9312
ID_SERIAL=Generic_STORAGE_DEVICE_0302258591
ID_TYPE=disk
ID_BUS=usb
ID_PATH=pci-0000:00:02.2-usb-0:2:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=vfat
ID_FS_VERSION=FAT32
ID_FS_UUID=4581-59D0
ID_FS_LABEL=PODCASTS
ID_FS_LABEL_SAFE=PODCASTS

Using "udevmonitor" as I plugged in the card, I found out which device it used (/dev/sdc1) and then used that in the mtools.conf entry. Then I was able to run mlabel to label my card.
When I had used kde to change the name of a different card, I had a typo and accidental return, and had given it a dumb name of "-" and I was stuck with it. But I found that that name wasn't the label anyway.

jschiwal 05-03-2007 12:11 AM

Just an FYI. I thought I would add a vfat /media/.hal-mtab entry:
Code:

/dev/sdc1      1000    0      vfat    nosuid,nodev,uid=1000,noatime,utf8,shortname=lower      /media/PODCASTS

Maybe some of the options would be useful.


gawdin 05-03-2007 09:08 PM

I really am sorry but I don't think one of us is understanding the other. I can not modify fstab I am looking how to specifically get it so I can modify it.

-Edit: ok I have root privs now but still won't let me edit the fstab to add/modify the mounts

it may help if I gave you this information:(this is my current fstab file

Code:

/dev/hda2    /                    reiserfs    acl,user_xattr    1 1
/dev/hda3    /home                reiserfs    acl,user_xattr    1 2
/dev/hda1    swap                  swap        defaults          0 0
proc          /proc                proc        defaults          0 0
sysfs        /sys                  sysfs        noauto            0 0
debugfs      /sys/kernel/debug    debugfs      noauto            0 0
usbfs        /proc/bus/usb        usbfs        noauto            0 0
devpts        /dev/pts              devpts      mode=0620,gid=5    0 0


jschiwal 05-03-2007 09:46 PM

Quote:

Originally Posted by jludwig
I don't use flash memory, but, with the new udev?? setup when you edit fstab you need to make it immutable so it is not overwritten the next time you reboot.

From the command line, as root;
[root@localhost ~]# chattr +i /etc/fstab

SuSE doesn't dynamically change the /etc/fstab file.

gawdin 05-03-2007 09:49 PM

Quote:

Originally Posted by jschiwal
SuSE doesn't dynamically change the /etc/fstab file.

:scratch: so...... if I can't change the fstab then how do I make it accept the flash media?

jschiwal 05-03-2007 09:57 PM

Quote:

Originally Posted by gawdin
I really am sorry but I don't think one of us is understanding the other. I can not modify fstab I am looking how to specifically get it so I can modify it.

-Edit: ok I have root privs now but still won't let me edit the fstab to add/modify the mounts

it may help if I gave you this information:(this is my current fstab file

Code:

/dev/hda2    /                    reiserfs    acl,user_xattr    1 1
/dev/hda3    /home                reiserfs    acl,user_xattr    1 2
/dev/hda1    swap                  swap        defaults          0 0
proc          /proc                proc        defaults          0 0
sysfs        /sys                  sysfs        noauto            0 0
debugfs      /sys/kernel/debug    debugfs      noauto            0 0
usbfs        /proc/bus/usb        usbfs        noauto            0 0
devpts        /dev/pts              devpts      mode=0620,gid=5    0 0


If you have root access, what is the problem with editing? You can use any editor to edit it.
sudo vim /etc/fstab
or
kdesu kate /etc/fstab

The fstab file has a man page you can reference.
If you used the command:
chattr +i /etc/fstab
to protect the file, you need to clear the immutable bit to be able to edit it as root:
chattr -i /etc/fstab

jschiwal 05-03-2007 10:44 PM

Quote:

Originally Posted by gawdin
:scratch: so...... if I can't change the fstab then how do I make it accept the flash media?

You can manually edit the fstab entry. I was saying that udev/hal doesn't automatically make changes to it behind your back.
You need to be root to edit it, but it is a simple text file, so any text editor will do. I usually use vim:
sudo vim /etc/fstab.
If you want to use a graphical editor, you could use kate:
kdesu kate /etc/fstab


All times are GMT -5. The time now is 11:54 PM.