LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Problem with a new Hard Disk and fstab (https://www.linuxquestions.org/questions/linux-server-73/problem-with-a-new-hard-disk-and-fstab-906251/)

baldur2630 10-03-2011 05:21 PM

Problem with a new Hard Disk and fstab
 
I feel embarrassed to ask this, but I've never had to do it before and I'm stuck!

I'm running a CentOS 6 Server (on VMware ESX 4i. I added a second virtual hard disk.

I created the Partition and formatted (ext3) it, without a problem I labeled it work. Now I need to mount it and I have to put an entry into fstab, I googled for an answer and found several :

LABEL=/work etc., I tried this and lots of variations, but none of them work.

Will someone please point me in the right direction? Is it CentOS 6 which is different or VMware virtual disks or is it just me being dumb?

T3RM1NVT0R 10-03-2011 05:58 PM

@ Reply
 
It should look something like this in /etc/fstab:

Code:

LABEL=work      /abc/home/            ext3          defaults          0 0
where,

LABEL=work : Is the label that you have set for your partition
/abc/home/ : Is the mount point where you want to mount the partition.
ext3 : Is the file system type
defaults: mount option, you can specify other options as per your requirement.

Make sure you are mount the partition on a directory that is empty otherwise your data will become inaccessible. Before rebooting the server run the following command to make sure that the new entry in /etc/fstab is mounting the partition properly:

Code:

mount -a
I hope this helps.

frankbell 10-03-2011 08:07 PM

The Arch Wiki has an excellent article on fstab; the section on labels is about half-way down the page.

I have never used labels in fstab myself; I can see how they might have some utility in a organizational system, but not in a personal one.

The Arch Wiki is an excellent resource, regardless of which distro one might use.

baldur2630 10-04-2011 02:26 AM

It doesn't work!

The label is work, mkdir /work (I checked, it created it).
LABEL=/work /work ext3 defaults 0 0

mount -a gives me a message : mount: special device LABEL=/work does not exist

The partition IS labeled work and the partition IS formatted ext3 according to parted. Even more confusing, the Arch Wiki says :
LABEL=Arch_Linux / ext4 defaults,noatime 0 1

so no / before the label name

I tried :
/dev/sdb1 /work ext3 defaults 0 0

and this worked, so the problem is sorta solved, but I would like to know why the label doesn't work.

T3RM1NVT0R 10-04-2011 02:30 AM

@ Reply
 
You only said the answer. You said that the label is "work' then why you are trying to use /work. Check my previous post.

baldur2630 10-04-2011 02:53 AM

Sorry, I tried it without the / and it worked. I just wonder why all the docs I read from CentOS (and others all say LABEL=/name.

Problem solved. Thanks for the help. I have another question, but I'll post that as a separate thread so as not to be confusing


All times are GMT -5. The time now is 03:55 AM.