maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Troubleshooting (https://talk.maemo.org/forumdisplay.php?f=6)
-   -   Please help me (https://talk.maemo.org/showthread.php?t=13520)

Mitsiboy 2007-12-20 18:16

Please help me
 
I am trying to add a script to mount my hd without having to go through root everytime. I have been using thoughfix's scripts, but I cannot figure out how to add the lines to /etc/sudoers. Also, I am not sure what to do with the scripts that start with "echo". I have VIM installed, but not sure what to do. Please help me out.

Johnx 2007-12-20 23:27

Re: Please help me
 
If you don't know how to use vim (and really, no one would blame you) I suggest installing nano (apt-get install nano). then just become root and run:
Code:

nano /etc/sudoers
Nano is pretty self explanatory. Just remember that when it says "^G = Get Help" it means hit Ctrl-G.

Good luck!

-John

Mitsiboy 2007-12-20 23:45

Re: Please help me
 
Ok I figured out how to add the lines. But what do I do with the "echo" lines?

BanditRider 2007-12-21 00:09

Re: Please help me
 
You want to add a line to /etc/fstab that includes the users keyword so that a normal user can mount the drive. The syntax of the line is six fields separated by whitespace (spaces or tabs and it doesn't matter how many) The fields are:
  1. The device i.e /dev/sdb3 or /dev/mmcblk0p1
  2. The mountpoint - The directory where you want to mount your device.
    It must exist. i.e. /mnt/fat1 or /media/mmc1
  3. The filesystem on the device i.e. vfat or ext3 or whatever.
  4. A comma separated list of keyword options. Some useful options are:
    rw - mount the device read/write
    auto / noauto Mount the device automatically with "mount -a" (which is done at boottime.
    users - allow normal users to mount the device
    exec - allow programs to be executed (run) from the device.
  5. fs_freq - Is used by the dump command. Just set it to zero
  6. fs_passno - Is used by fsck to determine the order in which filesystems are checked at reboot time. Again, just set it to zero.

A few examples:
On my linux box there is a line in /etc/fstab like this

/dev/sdb3 /mnt/fat1 vfat auto,users,rw,exec,umask=000 0 0

which mounts the third partition on my second harddrive to the /mnt/fat1 directory.

On my 770, the mmc card has several partitions. The first one is a FAT32 partition and is automatically mounted at boottime with this line in /etc/fstab:

/dev/mmcblk0p1 /media/mmc1 vfat rw,noauto,nodev,nosuid,utf8,uid=29999 0 0

More info on the fstab file and the mount command can be found by Googling for their manpages.

Once you have the proper line in /etc/fstab, you can mount the device by referring to the mountpoint i.e. "mount /mnt/fat1"

Mitsiboy 2007-12-21 01:04

Re: Please help me
 
So if I add a line to the fstab like this it should work?
/dev/sda1 /media/mmc1/hd vfat rw,auto
I am not sure what the nodev and the nosuid are or should be. I would like it to automount on boot, if that is possible. I had read posts earlier about not being able to auto detect unlike the mc. Thanks for the help so far.

Mitsiboy 2007-12-21 01:38

Re: Please help me
 
Ok I was just doing some more reading, if I use this line will it work
/dev/sda1 /media/mmc1/hd vfat rw,auto 0 0
the hd is sda1 it will be mounted at media/mmc1/hd and I want it to auto mount on boot.

wetcoast 2007-12-21 02:03

Re: Please help me
 
If you don't know how to use vim (and really, no one would blame you)

Wanna bet? ;-)

I took the bait and climbed the learning curve to learn vim and I've never been able to find an editor that I like better since. I write code, articles, email, you name it... all in vim. A few times a year I try whatever is new, but find myself wanting, no *yearning*, for my modal editor, my super-helpful, ultra-fast, very productive, vim.

Those who press ESC in a web text box or hjkl or $ or ESC shift a before realizing that they don't have the power of vi(m) at hand ... well, you know what I mean.

More seriously though, a basic understanding of vi(m) is useful; you can edit on any *nix box regardless of what might/might not be installed, vi almost always is. You don't have to drink all the koolaid to be productive enough for the odd task that comes along.

BanditRider 2007-12-21 11:04

Re: Please help me
 
I would use /media/hd instead of /media/mmc1/hd because your mmc card gets mounted at mmc1. But it might work. Also add users to the option list to allow non-root users to mount the device. As far as auto mounting at boot time, that depends on whether or not the usb host mode stuff is up and running before the mount -a happens. If it doesn't automount, just run mount -a.

/dev/sda1 /media/hd vfat rw,auto,users 0 0

should work.

Mitsiboy 2007-12-21 12:33

Re: Please help me
 
Thanks alot, I will try that and let you know. Do I have to do anything else to view the hd after it boots?

Mitsiboy 2007-12-21 15:39

Re: Please help me
 
when I type mount -a it tells me that it failed:invalid argument

BanditRider 2007-12-22 01:05

Re: Please help me
 
Does the mountpoint exist?

Mitsiboy 2007-12-22 01:44

Re: Please help me
 
yes the directory is there.

Mitsiboy 2007-12-22 04:24

Re: Please help me
 
ok I changed from auto to noauto and the invalid argument when away but it still does not mount the drive

BanditRider 2007-12-22 11:10

Re: Please help me
 
try mount /media/hd


All times are GMT. The time now is 21:22.

vBulletin® Version 3.8.8