LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Adding an entry in fstab -now won't load (https://www.linuxquestions.org/questions/linux-newbie-8/adding-an-entry-in-fstab-now-wont-load-602214/)

tractng 11-25-2007 04:53 AM

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

Glennzo 11-25-2007 05:03 AM

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.

shobhit 11-25-2007 06:01 AM

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.

Brian1 11-25-2007 08:20 AM

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

Brian

tractng 11-25-2007 01:12 PM

Quote:

Originally Posted by shobhit (Post 2970003)
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

michaelk 11-25-2007 08:52 PM

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.

Glennzo 11-26-2007 02:58 AM

Quote:

Originally Posted by tractng (Post 2970321)
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.

tractng 11-27-2007 03:50 AM

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

Glennzo 11-27-2007 04:06 AM

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.

michaelk 11-27-2007 06:27 AM

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

Glennzo 11-27-2007 06:36 AM

Why are we using LABEL in the fstab file?

tractng 11-27-2007 10:56 AM

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

tractng 11-28-2007 01:15 AM

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

Glennzo 11-28-2007 04:25 AM

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.

tractng 11-28-2007 11:11 AM

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


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