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 02-27-2008, 02:07 AM   #1
mathimca05
Member
 
Registered: Oct 2007
Posts: 66

Rep: Reputation: 15
Thumbs up How to create an entry in fstab file


Hai
I have created a linux partition using fdisk.its created succcessfully.
This is our partition table

[root@jingla barun]# /sbin/fdisk -l

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 765 6144831 83 Linux
/dev/hdb2 * 766 2677 15358140 c W95 FAT32 (LBA)
/dev/hdb3 2678 3697 8193150 83 Linux
/dev/hdb4 3698 9729 48452040 5 Extended
/dev/hdb5 3698 4972 10241406 83 Linux
/dev/hdb6 4973 5992 8193118+ 83 Linux
/dev/hdb7 5993 6123 1052226 82 Linux swap / Solaris
/dev/hdb8 6124 7340 9775521 7 HPFS/NTFS
/dev/hdb9 7341 8341 8040501 83 Linux


we created /dev/hdb9.

but our df -h is not showing the newly created partition,
[root@jingla barun]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hdb1 5.7G 1.8G 3.7G 33% /
tmpfs 236M 0 236M 0% /dev/shm
/dev/hdb5 9.5G 7.7G 1.4G 86% /home
/dev/hdb3 7.6G 4.6G 2.6G 65% /usr
/dev/hdb6 7.6G 203M 7.0G 3% /usr/local


our question is whether it will create an entry in fstab automatically after creating the partition...
this is our fstab file
LABEL=/1 / ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
LABEL=/home /home ext3 defaults 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/usr/local /usr/local ext3 defaults 1 2
LABEL=SWAP-hda7 swap swap defaults 0 0

what to do for that?can anyone suggest me?
 
Old 02-27-2008, 02:23 AM   #2
vedang
Member
 
Registered: May 2006
Posts: 89

Rep: Reputation: 15
New entry in fstab file.

It seems that you have successfully created a new partition, but you have not created filesystem on it.

use
#mkfs -t ext3 /dev/hdb9

This command will create ext3 filesystem on it.
/etc/fstab does not read new partitions automatically. You have to manually enter information for each new partition.

In your case go to end of /etc/fstab file and add line for your new partition.

/dev/hdb9 /data ext3 defaults 1 2

/data is a mountpoint for your new partiton. You have to create /data directory. Be careful while modifying /etc/fstab file. After editing fstab file reboot your system and then check


#df -h commanf and
#cat /etc/mtab

Df -h command will show you size of partiton, used and avalible.
cat /etc/mtab will show you that your /dev/hdb9 is mounted as /data.
 
Old 02-27-2008, 05:17 AM   #3
harsshal
Member
 
Registered: Jul 2006
Location: New York, NY
Distribution: redhat,ubuntu,RHEL,fedora,centOS
Posts: 105

Rep: Reputation: 15
Thumbs up fstab entries

information abt fstab

Ex./dev/hdb9 /data -t ext3 defaults 1 2

col 1:/dev/hdb8 -device
col 2:/data -mount point
col 3:ext3 -FS type
col 4:defaults -RW setting(can specify group ID and chmod here)
col 5:1 -crash dump(lost + found folder)
col 6:2 -mount order(1 for root and 2 for others)
 
Old 11-22-2010, 01:45 AM   #4
piyusharora420
Member
 
Registered: Nov 2010
Posts: 93

Rep: Reputation: 0
Question

LABEL=/home /home ext3 defaults 1 2
LABEL=/home /home ext3 defaults 0 0

see above two entries and tell me why to use 1 2 instead of 0 0 at last?
what is meaning of 1 2 and 0 0 ?
 
Old 11-22-2010, 02:03 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
See the man page for fstab (i.e. "man fstab"), as all the columns are explained there.
 
Old 12-02-2010, 12:02 AM   #6
manoj namdev
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
firstly you have to reboot your system after creating the partition or use partprobe /dev/hda commmand in place of reeboot

then

#mkfs -t ext3 /dev/hdb9

This command will create ext3 filesystem on it.
/etc/fstab does not read new partitions automatically. You have to manually enter information for each new partition.

In your case go to end of /etc/fstab file and add line for your new partition.

/dev/hdb9 /data ext3 defaults 1 2

/data is a mountpoint for your new partiton. You have to create /data directory. Be careful while modifying /etc/fstab file. After editing fstab file reboot your system and then check


#df -h
 
Old 12-02-2010, 01:07 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
manoj namdev, this thread is from 2008, so I doubt the OP cares any more.
 
  


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
Mounting windows share via cifs (fstab entry) - error 13 opening credentials file O(V)eGA_l2el) Linux - Networking 2 12-05-2006 12:22 PM
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
entry in fstab file Tinku Linux - General 6 10-02-2004 01:06 AM
adding an entry to /etc/fstab file and another query Tinku Linux - General 3 08-11-2004 09:35 PM


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