LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-06-2007, 08:00 PM   #1
gawdin
LQ Newbie
 
Registered: Mar 2007
Location: Ohio, United States of America
Distribution: Suse Linux Enterprise 10 server and desktop; Suse Linux 10
Posts: 23

Rep: Reputation: 15
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?
 
Old 05-06-2007, 08:16 PM   #2
buggabill
Member
 
Registered: Jun 2006
Location: Maine, USA
Distribution: Kubuntu 8.10/Debian Lenny
Posts: 30

Rep: Reputation: 15
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
 
Old 05-06-2007, 08:54 PM   #3
gawdin
LQ Newbie
 
Registered: Mar 2007
Location: Ohio, United States of America
Distribution: Suse Linux Enterprise 10 server and desktop; Suse Linux 10
Posts: 23

Original Poster
Rep: Reputation: 15
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

Last edited by gawdin; 05-06-2007 at 09:00 PM.
 
Old 05-06-2007, 09:18 PM   #4
jaykup
Member
 
Registered: Jan 2006
Location: Mukwonago, WI
Distribution: Slackware 12
Posts: 77

Rep: Reputation: 16
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!

Last edited by jaykup; 05-06-2007 at 09:24 PM.
 
Old 05-06-2007, 09:18 PM   #5
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,960

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
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.
 
Old 05-06-2007, 09:28 PM   #6
jaykup
Member
 
Registered: Jan 2006
Location: Mukwonago, WI
Distribution: Slackware 12
Posts: 77

Rep: Reputation: 16
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"
 
Old 05-06-2007, 09:31 PM   #7
gawdin
LQ Newbie
 
Registered: Mar 2007
Location: Ohio, United States of America
Distribution: Suse Linux Enterprise 10 server and desktop; Suse Linux 10
Posts: 23

Original Poster
Rep: Reputation: 15
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 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

Last edited by gawdin; 05-06-2007 at 09:49 PM.
 
Old 05-06-2007, 10:43 PM   #8
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,960

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
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.

Last edited by rkelsen; 05-06-2007 at 10:54 PM.
 
Old 05-06-2007, 11:20 PM   #9
gawdin
LQ Newbie
 
Registered: Mar 2007
Location: Ohio, United States of America
Distribution: Suse Linux Enterprise 10 server and desktop; Suse Linux 10
Posts: 23

Original Poster
Rep: Reputation: 15
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
 
Old 05-07-2007, 12:04 AM   #10
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 1,960

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
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.
 
Old 05-07-2007, 12:15 AM   #11
gawdin
LQ Newbie
 
Registered: Mar 2007
Location: Ohio, United States of America
Distribution: Suse Linux Enterprise 10 server and desktop; Suse Linux 10
Posts: 23

Original Poster
Rep: Reputation: 15
I will remember that (grandpa always says google is your friend)


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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 07:15 AM
newbie vs fstab. fstab wins :( blop Linux - Newbie 3 01-07-2005 06:54 AM
(version 5.1 chapter 08 fstab) vs (man fstab) rgiggs Linux From Scratch 2 06-03-2004 06:55 PM
fstab true_atlantis Linux - General 3 12-01-2003 05:27 PM


All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration