Mengenal Label [e2label] & grub

25 Jan

1. contoh grub.conf dengan label
[root@test41 ~]# vi /boot/grub/grub.conf
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-128.el5 ro root=LABEL=/ acpi=force
initrd /initrd-2.6.18-128.el5.img

2. contoh fstab dengan label

[root@test41 ~]# vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/u02 /u02 ext3 defaults 1 2
LABEL=/u01 /u01 ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
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
LABEL=SWAP-sda5 swap swap defaults 0 0

3. cari tahu label
[root@test41 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 15G 3.9G 9.6G 29% /
/dev/sda6 37G 25G 11G 70% /u02
/dev/sda2 15G 11G 3.2G 77% /u01
/dev/sda1 99M 12M 83M 13% /boot
tmpfs 1.5G 0 1.5G 0% /dev/shm

[root@test41 ~]# e2label /dev/sda3
/
[root@test41 ~]# e2label /dev/sda6
/u02
[root@test41 ~]# e2label /dev/sda2
/u01

4. set label
[root@test41 ~]# mkdir /u03
[root@test41 ~]# mkdir /u04
[root@test41 ~]# e2label /dev/hdc1 /u03
[root@test41 ~]# e2label /dev/hdc2 /u04

5. tambahkan
[root@test41 ~]# vi /etc/fstab
LABEL=/u03 /u03 ext3 defaults 1 2
LABEL=/u04 /u04 ext3 defaults 1 2

6. test dengan reboot, apakah error ?
[root@test41 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 15G 3.9G 9.6G 29% /
/dev/hda6 37G 25G 11G 70% /u02
/dev/hda2 15G 11G 3.2G 77% /u01
/dev/hda1 99M 12M 83M 13% /boot
/dev/hdc1 276G 192M 261G 1% /u03
/dev/hdc2 184G 188M 174G 1% /u04
tmpfs 1.5G 0 1.5G 0% /dev/shm

7. label untuk swap
[root@test41 ~]# mkswap /dev/sda5 -L SWAP-sda5

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: