Hi All,
Sometimes we might need to a disk to the linux systems. Once storage side allocation done we can follow below steps. Modify path as per your environment and requirement.
[root@oranode1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 29.5G 0 part
├─rhel-root 253:0 0 26.5G 0 lvm /
└─rhel-swap 253:1 0 3G 0 lvm [SWAP]
sdb 8:16 0 30G 0 disk
sr0 11:0 1 1024M 0 rom
[root@oranode1 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62914559, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-62914559, default 62914559):
Using default value 62914559
Partition 1 of type Linux and of size 30 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@oranode1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 29.5G 0 part
├─rhel-root 253:0 0 26.5G 0 lvm /
└─rhel-swap 253:1 0 3G 0 lvm [SWAP]
sdb 8:16 0 30G 0 disk
└─sdb1 8:17 0 30G 0 part
sr0 11:0 1 1024M 0 rom
[root@oranode1 ~]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 xfs 05356daf-d70a-4ad8-b3cd-e723f9b11202 /boot
└─sda2 LVM2_member og6zr5-d0yl-edhh-CFFl-aqL2-gBCA-rqkdsW
├─rhel-root xfs b0c3ea90-e651-40e8-bd27-62b461914edd /
└─rhel-swap swap 5a9c4a80-1b23-4065-8a74-33aab0a167e4 [SWAP]
sdb
└─sdb1
sr0
[root@oranode1 ~]# mkfs.xfs /dev/sdb1
meta-data=/dev/sdb1 isize=256 agcount=4, agsize=1966016 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0
data = bsize=4096 blocks=7864064, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=4096 blocks=3839, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@oranode1 u01]# mkdir /u02
[root@oranode1 u01]# mount /dev/sdb1 /u02
[root@oranode1 u01]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 29.5G 0 part
├─rhel-root 253:0 0 26.5G 0 lvm /
└─rhel-swap 253:1 0 3G 0 lvm [SWAP]
sdb 8:16 0 30G 0 disk
└─sdb1 8:17 0 30G 0 part /u02
sr0 11:0 1 1024M 0 rom
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 30G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 29.5G 0 part
├─rhel-root 253:0 0 26.5G 0 lvm /
└─rhel-swap 253:1 0 3G 0 lvm [SWAP]
sdb 8:16 0 30G 0 disk
└─sdb1 8:17 0 30G 0 part /u02
sr0 11:0 1 1024M 0 rom
[root@oranode1 u01]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 27G 15G 12G 57% /
devtmpfs 697M 0 697M 0% /dev
tmpfs 706M 96K 706M 1% /dev/shm
tmpfs 706M 9.0M 697M 2% /run
tmpfs 706M 0 706M 0% /sys/fs/cgroup
/dev/sda1 497M 122M 376M 25% /boot
/dev/sdb1 30G 33M 30G 1% /u02
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 27G 15G 12G 57% /
devtmpfs 697M 0 697M 0% /dev
tmpfs 706M 96K 706M 1% /dev/shm
tmpfs 706M 9.0M 697M 2% /run
tmpfs 706M 0 706M 0% /sys/fs/cgroup
/dev/sda1 497M 122M 376M 25% /boot
/dev/sdb1 30G 33M 30G 1% /u02
Add an entry like below in /etc/fstab
/dev/sdb1 /u02 xfs defaults 0 0
We are done!!!!
Thanks,
No comments:
Post a Comment