LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-03-2011, 05:21 PM   #1
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 127

Rep: Reputation: 16
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?
 
Old 10-03-2011, 05:58 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,692

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
@ 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.
 
Old 10-03-2011, 08:07 PM   #3
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, Mint
Posts: 7,322

Rep: Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381Reputation: 1381
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.
 
Old 10-04-2011, 02:26 AM   #4
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 127

Original Poster
Rep: Reputation: 16
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.
 
Old 10-04-2011, 02:30 AM   #5
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,692

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
@ 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.
 
Old 10-04-2011, 02:53 AM   #6
baldur2630
Member
 
Registered: Jan 2007
Location: Belgium
Distribution: CentOS & Ubuntu
Posts: 127

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


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
[SOLVED] fstab entry to mount second Hard disk. flatstan Suse/Novell 5 02-11-2010 07:10 AM
fstab problem with external USB hard disk Szkarbek Linux - General 3 05-31-2009 11:32 AM
USB external hard disk and fstab sblantipodi Linux - General 8 01-06-2008 01:14 PM
what entries to put into fstab for new hard disk? chuck_notorious Linux - Hardware 1 04-21-2004 03:37 AM
Mounting hard disk through fstab aiims1777 Linux - Newbie 5 11-05-2003 05:36 AM


All times are GMT -5. The time now is 05:01 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration