Search This Blog

Total Pageviews

Monday 1 May 2017

How to Create, configure and mount a new Linux file system


New File system linux 

[root@vbgeneric ~]# 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
  ├─ol-root 252:0    0 26.5G  0 lvm  /
  └─ol-swap 252:1    0    3G  0 lvm  [SWAP]
sdb           8:16   0   30G  0 disk /u01
sdc           8:32   0   20G  0 disk
sr0          11:0    1 1024M  0 rom


[root@vbgeneric ~]# fdisk /dev/sdc
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.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xc75b4126.

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):
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set


[root@vbgeneric ~]# 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
  ├─ol-root 252:0    0 26.5G  0 lvm  /
  └─ol-swap 252:1    0    3G  0 lvm  [SWAP]
sdb           8:16   0   30G  0 disk /u01
sdc           8:32   0   20G  0 disk
└─sdc1        8:33   0   20G  0 part
sr0          11:0    1 1024M  0 rom


 mkfs.ext3 /dev/sdc
mke2fs 1.42.9 (28-Dec-2013)
/dev/sdc is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5242880 blocks
262144 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

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

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

[root@vbgeneric ~]# mkdir -p /u02

[root@vbgeneric ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Jun 30 14:58:09 2015
#
# 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/ol-root     /                       xfs     defaults        0 0
UUID=08976b02-695c-440c-a09a-b7ef53538c77 /boot                   xfs     defaults        0 0
/dev/mapper/ol-swap     swap                    swap    defaults        0 0
/dev/sdb        /u01    ext4    defaults        0 0
/dev/sdc        /u02    ext3    defaults        0 0

[root@vbgeneric ~]# mount /dev/sdc /u02

[root@vbgeneric ~]# df -Ph
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ol-root   27G  3.3G   24G  13% /
devtmpfs             858M     0  858M   0% /dev
tmpfs                873M  518M  356M  60% /dev/shm
tmpfs                873M   25M  848M   3% /run
tmpfs                873M     0  873M   0% /sys/fs/cgroup
/dev/sdb              30G   25G  3.6G  88% /u01
/dev/sda1            497M  179M  319M  36% /boot
tmpfs                175M  8.0K  175M   1% /run/user/54321
tmpfs                175M     0  175M   0% /run/user/0
/dev/sdc              20G   45M   19G   1% /u02
[root@vbgeneric ~]#



[oracle@vbgeneric Upgrade]$ 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
  ├─ol-root 252:0    0 26.5G  0 lvm  /
  └─ol-swap 252:1    0    3G  0 lvm  [SWAP]
sdb           8:16   0   30G  0 disk /u01
sdc           8:32   0   20G  0 disk /u02
sr0          11:0    1 1024M  0 rom

fdisk -l  /dev/sdc

No comments:

Oracle DBA

anuj blog Archive