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? |
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. |
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) |
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 ? |
See the man page for fstab (i.e. "man fstab"), as all the columns are explained there.
|
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 |
manoj namdev, this thread is from 2008, so I doubt the OP cares any more.
|
All times are GMT -5. The time now is 05:11 PM. |