Monday 12 August 2019

Creating a persistent File System on an OEL 6.7 Virtual Machine

[root@srv2 ~]# fdisk /dev/sdg
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xf5ff222a.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610):
Using default value 2610

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.


[root@srv2 ~]# /sbin/mkfs.ext4 -L /u02 /dev/sdg1
mke2fs 1.43-WIP (20-Jun-2013)
Filesystem label=/u02
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000

Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 

[root@srv2 ~]#

[root@srv2 ~]# mkdir /u02
[root@srv2 ~]# mount /dev/sdg1 /u02
[root@srv2 ~]# mount
/dev/mapper/vg_srv1-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
oracleasmfs on /dev/oracleasm type oracleasmfs (rw)
varun_docs on /media/sf_varun_docs type vboxsf (gid=491,rw)
/dev/sdg1 on /u02 type ext4 (rw)
[root@srv2 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_srv1-lv_root
                                    93G   15G   73G  18% /
tmpfs                           2.8G   72K  2.8G   1% /dev/shm
/dev/sda1                     477M  149M  299M  34% /boot
varun_docs                  466G  411G   55G  89% /media/sf_varun_docs
/dev/sdg1                     20G   44M   19G   1% /u02
[root@srv2 ~]#


[root@srv2 ~]# vi /etc/fstab
[root@srv2 ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Mon Jun 24 13:03:22 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_srv1-lv_root /                       ext4    defaults        1 1
UUID=a9d9e97e-f7f0-4490-84eb-f65ecc317372 /boot                   ext4    defaults        1 2
/dev/mapper/vg_srv1-lv_swap swap                    swap    defaults        0 0
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=/u02           /u02                 ext4    defaults        1 2

[root@srv2 ~]# 


No comments:

Post a Comment