LinuxQuestions.org
Review your favorite Linux distribution.
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 11-25-2007, 05:53 AM   #1
tractng
Member
 
Registered: Nov 2007
Posts: 75

Rep: Reputation: 15
Adding an entry in fstab -now won't load


Guys,

I have disk sdc that I just partion and mounted. Here is what I did.

fdisk /dev/sdc (then I choose add a new partition in the menu list, extended partition, took default prompt for cyclinder and the rest)
mkfs /dev/sdc
mkdir /vol2
mount /dev/sdc /vol2

I went into fstab and add the following entry near the end.

LABEL=/vol2 /vol2 ext3 defaults 1 2

Now my system won't boot up. I am getting this message:

fsk: ext3: unable to resolve "LABEL'=vol2'

"Give root password for maintenance (or type Control-D to continue):

Did I specify the wrong filesytem type? How can i fix this?


Thanks,
Tony

Last edited by tractng; 11-25-2007 at 06:00 AM.
 
Old 11-25-2007, 06:03 AM   #2
Glennzo
Member
 
Registered: May 2003
Location: Salem, Mass USA
Distribution: Fedora
Posts: 393

Rep: Reputation: 47
Fstab should look something like /dev/sdc1 /vol2 ext3 defaults 0 0, then type in a terminal mount /vol2. You should really create the mount point under /mnt or /media.
 
Old 11-25-2007, 07:01 AM   #3
shobhit
Member
 
Registered: Sep 2003
Location: kolkata
Distribution: Fedora 7
Posts: 60

Rep: Reputation: 15
The problem is with the LABEL part.
If you want to have a label, you need to specify it while creating the partition. If you simply add LABEL in fstab only it won't work.

The entry given by Glennzo above should work for you.
 
Old 11-25-2007, 09:20 AM   #4
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Or add the LABEL you define manually to /etc/mtab. Just compare to exist ones in the file.

Brian
 
Old 11-25-2007, 02:12 PM   #5
tractng
Member
 
Registered: Nov 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by shobhit View Post
The problem is with the LABEL part.
If you want to have a label, you need to specify it while creating the partition. If you simply add LABEL in fstab only it won't work.

The entry given by Glennzo above should work for you.
Shobhit,

During the partition, I remember it asked me to enter some accounting information (some sort like that). I just left it blank and hit enter. Is this where I should have specify my label?


Glenzo,

Is this really good practice to mount it in mnt or media?


Brian,

If I define it in mtab with my current settings, I should be fine?

default 0 0, is that a boot up sequence that the system look for when it boots up. The reason I put 1 2 is I just copied of what was in the fstab lol!!


Thanks guys. I am just learning my ways and like to know all options.

tony
 
Old 11-25-2007, 09:52 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,930

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
You should not manually edit the /etc/mtab file. This is automatically updated by the mount command to show what filesystems are in use.

What distribution did you install? Most use either /mnt or /media for removable filesystems i.e. USB drives, CDs/DVDs, floppies etc or anything not associated with the operating system. No law says you have to.

Those numbers that were displayed during the partitioning process in a nutshell tell you the partition ID and where it is located on the hard drive. labels are part of the filesystem and are specified during the formating process. To use labels in the fstab file you must first have actually labeled the partition. In addition you must specify the partition ID in your fstab file too.

What was the ID of the partition you created? If you do not remember you can use the fdisk command:
fdisk -l /dev/sdc (that is a small L and you must be root)

You must specify the partition ID when creating the file system. To create an ext3 filesystem
mk2fs -t ext3 -j -L label_name /dev/sdc1 (example only, you must specify the real partition ID. You could lose data if not careful).
You can specify a label using tune2fs after the filesystem is created.

Google for fstab and mount command for information about what defaults and the 0 0 mean. defaults is a predefined list of options that apply when that filesystem is mounted.
 
Old 11-26-2007, 03:58 AM   #7
Glennzo
Member
 
Registered: May 2003
Location: Salem, Mass USA
Distribution: Fedora
Posts: 393

Rep: Reputation: 47
Quote:
Originally Posted by tractng View Post
Shobhit,
Glenzo,

Is this really good practice to mount it in mnt or media?
tony
Mount them anywhere you want. When I first started with Linux everything that was mounted by the system was mounted under /mnt. Now it's all under /media. I'm not talking about mounts I add. These are the ones that the system 'discovers' and mounts conveniently for you. I believe it's common practice to use /mnt or /media.
 
Old 11-27-2007, 04:50 AM   #8
tractng
Member
 
Registered: Nov 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Okay, I am really lost lol!!

Michaelk,

I am running Redhat ES 4 with update 6.

This is what I did.

1. mkfs -t ext3 -j -L vol3 /dev/sdc1 (mak3fs gave me command not found)

2. mdir /mnt/vol3

3. mount /dev/sdc1 /mnt/vol3

4. fstab entry looks like:

LABEL=/dev/sdc1 /mnt/vol3 ext3 defaults 0 0


I also tried:

LABEL=/vol3 /mnt/vol3 ext3 defaults 0 0


When booting I see a message "... special device LABEL = /dev/sdc1 does not exit."

If I do fdisk -l /dev/sdc , I get :

Device Boot Start End Blocks ID System
/dev/sdc1 1 19457 156288321 83 Linux


Thanks in advance,
Tony
 
Old 11-27-2007, 05:06 AM   #9
Glennzo
Member
 
Registered: May 2003
Location: Salem, Mass USA
Distribution: Fedora
Posts: 393

Rep: Reputation: 47
Why are you making filesystems? If you want to mount /dev/sdc1 all you need to do is make a mount point, mkdir /mnt/vol3. Then edit /etc/fstab and add a line at the bottom of the file like this: /dev/sdc1 /mnt/vol3 ext3 defaults 0 0. Then in a terminal type mount -a or mount /mnt/vol3 and the partition will be mounted. It's that simple. I think that you are making this more complicated than it really is. Here's the steps you need to take, and forget the LABEL stuff. Open a terminal as root. Type:
mkdir /mnt/vol3 <-- Assuming you haven't done this yet. If you did, skip this step.
gedit /etc/fstab <--- (use your favorite text editor)
/dev/sda1 /mnt/vol3 defaults 0 0 <--- Add this to the bottom. Use cut and paste if you want. This line will work for you. Save file.
mount /mnt/vol3 or mount -a <-- Use one command or the other.

Last edited by Glennzo; 11-27-2007 at 05:12 AM.
 
Old 11-27-2007, 07:27 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,930

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
As suggested you do not need to use volume labels in the fstab file.
However, you do need to use the exact label name that was used when you created the filesystem. The volume label you created as suggested by your last post is vol3 not /vol3 so your fstab entry should be:
label=vol3 /mnt/vol3 defaults 0 0

Last edited by michaelk; 11-27-2007 at 07:53 AM.
 
Old 11-27-2007, 07:36 AM   #11
Glennzo
Member
 
Registered: May 2003
Location: Salem, Mass USA
Distribution: Fedora
Posts: 393

Rep: Reputation: 47
Why are we using LABEL in the fstab file?
 
Old 11-27-2007, 11:56 AM   #12
tractng
Member
 
Registered: Nov 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Glennzo/Micaelk,

I will try again tonight since I am at work now.

I will try the one without the lable first. Then try the label.

I like to learn both

Please check back tomorrow.

Note: LABEL=/vol3 /mnt/vol3 ext3 defaults 0 0

I have the extra "/" in my post here, but I didn't have it on the fstab.


Thanks,
Tony
 
Old 11-28-2007, 02:15 AM   #13
tractng
Member
 
Registered: Nov 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Got it to work. I am suck a dork lol!! I kept on leaving the "LABEL" there on the fstab file. Once I took it out it works.


My pc hardware came today so I won't touch this machine for a few days. I need to use this machine to dump data files there until I get the old machine upgrade.

Should I pursue the LABEL part thing or is not good practice to use it?


Thanks a lot.


Tony
 
Old 11-28-2007, 05:25 AM   #14
Glennzo
Member
 
Registered: May 2003
Location: Salem, Mass USA
Distribution: Fedora
Posts: 393

Rep: Reputation: 47
Glad you got it working. Here's my /etc/fstab

[glenn@toshiba ~]$ cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sda7 swap swap defaults 0 0
/dev/sda2 /media/vista ntfs-3g defaults 0 0
/dev/sda6 /media/ubuntu ext3 defaults 0 0

And here's the output of the mount command

[glenn@toshiba ~]$ mount
/dev/sda5 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda2 on /media/vista type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
/dev/sda6 on /media/ubuntu type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
/dev/sdb1 on /media/MY POCKET type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=500)
/dev/sda1 on /media/TOSHIBA SYSTEM VOLUME type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)

The only mention of LABEL is with regards to the partition that Fedora 8 is installed on. The root partition. LABEL is not used anywhere else.
 
Old 11-28-2007, 12:11 PM   #15
tractng
Member
 
Registered: Nov 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Glennzo,

Thanks for your respond.


Last night, I took one step further but was stuck. My system consists the following disks --> sda/sdb/sdc.

In this post, I inquired about sdc where it was a blank disk (never mounted and without a partition define)

But on sdb, I had specify /software to be 100 gb out of that disk during the OS install so I still have the remainder of space in that disk.

Last night I did the following if I can recall:

1) fdisk /dev/sdb (then use the text menu to create the partition).

2) Next I did fdisk -lu /dev/sdb it lists

/dev/sdb (some stuff here that I cannot recall now)
/dev/sdb1 (some stuff here that I cannot recall now)

3) at this step, do I go straight into fstab and add an entry there and make a directory to mount? I tried creating a filesystems here but it won't allow me. I said something about if I specify the device correctly.

I forgot which part I went to specify the cyclinder head (starting point and ending point).

Anyways, I will try tomorrow to redo it once I get my data off the system.

Tony
 
  


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
To load a new entry in /etc/fstab without rebooting grautu Slackware 9 08-02-2006 12:31 AM
entry into /etc/fstab wetnose23 Slackware 2 01-07-2006 05:30 PM
/etc/fstab entry ryedunn Linux - Newbie 1 01-17-2005 02:45 AM
adding an entry to /etc/fstab file and another query Tinku Linux - General 3 08-11-2004 09:35 PM
fstab entry albean Linux - Newbie 1 12-04-2002 02:33 PM


All times are GMT -5. The time now is 10:20 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