LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fstab (https://www.linuxquestions.org/questions/linux-newbie-8/fstab-551811/)

gawdin 05-06-2007 07:00 PM

fstab
 
how do you save an edit to fstab or any file using a terminal edit (i used vim)

also does anyone know what entry in fstab should be for removable media like flash drives and external hard drives?

buggabill 05-06-2007 07:16 PM

1. You have to be root.
2. To save in vim, you use :wq!
3. The last question depends on what device name is used. I use Gentoo and when I use a usb drive it uses /dev/sda*. It all depends though. If it uses /dev/sda1 the entry would look something like:

/dev/sda1 /mnt/usb vfat auto,user

gawdin 05-06-2007 07:54 PM

hmm I don't actually know what it is using. Here is my fstab list of entries:

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

also mount -i while in gnome terminal:

Code:

/dev/hda2 on / type reiserfs (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/hda3 on /home type reiserfs (rw,acl,user_xattr)
securityfs on /sys/kernel/security type securityfs (rw)

now I have no idea what the majority of all this means but I believe those are what is use in mounting devices.

oh and thanks for how to save

jaykup 05-06-2007 08:18 PM

After you plug in your flash drive, type dmesg until you see something like the following. It may take a few seconds to scan the new drive.

Code:

usb 1-1: new high speed USB device using ehci_hcd and address 32
usb 1-1: configuration #1 chosen from 1 choice
scsi25 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 32
usb-storage: waiting for device to settle before scanning
scsi 25:0:0:0: Direct-Access    SanDisk  U3 Cruzer Micro  2.18 PQ: 0 ANSI: 2
SCSI device sdc: 4013713 512-byte hdwr sectors (2055 MB)
sdc: Write Protect is off
sdc: Mode Sense: 03 00 00 00
sdc: assuming drive cache: write through
SCSI device sdc: 4013713 512-byte hdwr sectors (2055 MB)
sdc: Write Protect is off
sdc: Mode Sense: 03 00 00 00
sdc: assuming drive cache: write through
sdc: sdc1
sd 25:0:0:0: Attached scsi removable disk sdc
sd 25:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete

It will usually come up as sd[abcdefg]1

First, make a folder you want to mount it to.

Code:

mkdir ~/usb_folder
Then, add the following line to fstab.

Code:

/dev/sda1    ~/usb_folder                  vfat          defaults            0 0
Last, plug in your drive if you haven't already done so, and type in

Code:

mount ~/usb_folder
When you are done using it, unmount it and unplug it.

Code:

umount ~/usb_folder
Now, provided it is created on sda1 (it should be this everytime if you properly unmount the drive each time before you remove it) and if you don't have any sata or scsi drives which it looks like you don't.

Good luck!

rkelsen 05-06-2007 08:18 PM

Quote:

Originally Posted by gawdin
also does anyone know what entry in fstab should be for removable media like flash drives and external hard drives?

Most distros these days are using HAL, which eliminates the need for fstab entries for your removable media. Last time I checked, Suse uses HAL.

If you aren't using HAL, then you'll need to work out the device name (perhaps using the 'dmesg' command) before you can mount the partitions. You don't need an fstab entry to mount removable media.

jaykup 05-06-2007 08:28 PM

rkelsen:

I'm not familiar with HAL. Do you mean you plug it in and it mounts somewhere automatically? (how does it know where with out fstab)?

You don't NEED fstab to mount a flash drive normally, but it makes it easier to do "mount folder" instead of "mount /dev/sda1 folder"

gawdin 05-06-2007 08:31 PM

Quote:

Originally Posted by rkelsen
Most distros these days are using HAL, which eliminates the need for fstab entries for your removable media. Last time I checked, Suse uses HAL.

If you aren't using HAL, then you'll need to work out the device name (perhaps using the 'dmesg' command) before you can mount the partitions. You don't need an fstab entry to mount removable media.


and might you be able to tell me how to run Hal?

and with that it would most definitely help if I knew what the entries meant in dmesg. dmesg: usb 1-1 or usb 2-1, etc... and most of them come up with an error:

Code:

usb 1-3: new high speed USB device using ehci_hcd and address 7
usb 1-3: device not accepting address 7, error -110

and it does this for 1-3 and 1-1 (the only 1-#'s) and 2-1 says:
USB disconnect, address 2

2-2 is my optical wireless mouse which it sees and recognizes.





On a completely unrelated note: I take pride in the things I know and I am good at what I do... but have I mentioned how much I feel like a :newbie: right now?

and due to deadlines I am going to install SUSE 10.1 (normal) and hope that it works. thanks for what you have taught me so far and lets hope this thread can be finished. lets see how many times I can solve my rubiks cube before the install is done :D

rkelsen 05-06-2007 09:43 PM

Quote:

Originally Posted by jaykup
I'm not familiar with HAL. Do you mean you plug it in and it mounts somewhere automatically? (how does it know where with out fstab)?

Magic. ;)

If you wanna see how it fundamentally works (with udev, etc), I have a set of scripts for Slackware which are a custom version of Debian's usbmount package. They are available in Slackware package format here: http://members.optusnet.com.au/rkelsen/usbmount.html Note: this really has nothing to do with HAL, but demonstrates auto-mounting without an fstab entry.
Quote:

Originally Posted by gawdin
and might you be able to tell me how to run Hal?

I thought that this was enabled by default on Suse.
Quote:

Originally Posted by gawdin
Code:

usb 1-3: device not accepting address 7, error -110

That sounds serious. Is the USB key working properly in other machines? It seems like you have a hardware issue somewhere. Have you customised your kernel? In some cases, updating the kernel to the latest available for your distro can solve issues like this.

gawdin 05-06-2007 10:20 PM

Quote:

I thought that this was enabled by default on Suse.
please remember before I found LQ I only knew the command cd, I have no idea what anything is until I am told or find out myself. Hal for example I keep hearing it brought up but no one mentions what or where it is.

and as for the usb drives mounting elsewhere. They mount on my windows systems just fine but the computer that runs linux doesn't see it even though the light comes on on the usb drive briefly

rkelsen 05-06-2007 11:04 PM

Quote:

Originally Posted by gawdin
Hal for example I keep hearing it brought up but no one mentions what or where it is.

Google is very handy for this sort of thing.
http://www.novell.com/products/linux...linux/hal.html
No matter what question you have to ask, chances are that someone else has already asked it.

gawdin 05-06-2007 11:15 PM

:study: I will remember that (grandpa always says google is your friend)


:jawa: Status update: Spiderman 3 is awesome and it was something to do with my SLED installation. I put SUSE 10.1 on and it booted just fine automatically (and ffs it had all the stuff on the dvd that SLES 10 had... except it actually installs, but that is a different story)


All times are GMT -5. The time now is 02:01 AM.