Format a Partition in Linux and mount the filesystem

Configurare noua (How To)


After a new partition is created, format the newly created partition using ‘mkfs‘ command, /dev/sdh1 is the newly created partition to work with.


— format the new partition as an ext3 file system type:

/sbin/mkfs -t ext3 /dev/sdh1

[root@OL4SAP001 DVD]# /sbin/mkfs -t ext3 /dev/sdh1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5242624 blocks
262131 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,

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

[root@OL4SAP001 DVD]#

— assigning a Label with e2label

/sbin/e2label /dev/sdh1 DVD_ORA4SAP_18c

[root@OL4SAP001 DVD]# /sbin/e2label /dev/sdh1 DVD_ORA4SAP_18c
[root@OL4SAP001 DVD]#

— check the label assigned :

/sbin/tune2fs -l /dev/sdh1 |grep volume

[root@OL4SAP001 DVD]# /sbin/tune2fs -l /dev/sdh1 |grep volume
Filesystem volume name: DVD_ORA4SAP_18c <=== LABEL=DVD_ORA4SAP_18c
-- then add the new partition to /etc/fstab, this way it will be mounted at reboot:

vi /etc/fstab 
add line : 
LABEL=DVD_ORA4SAP_18c /SOFTWARE/DVD/18c ext3 acl,user_xattr 1 2

— mount the filesystem

mkdir -p /SOFTWARE/DVD/18c 
chown oracle:dba /SOFTWARE/DVD/18c 
mount /dev/sdh1 /SOFTWARE/DVD/18c

[root@OL4SAP001 DVD]# mkdir -p /SOFTWARE/DVD/18c
[root@OL4SAP001 DVD]# chown oracle:dba /SOFTWARE/DVD/18c
[root@OL4SAP001 DVD]# mount /dev/sdh1 /SOFTWARE/DVD/18c
[root@OL4SAP001 DVD]# df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 1866396 0 1866396 0% /dev
tmpfs 1890932 0 1890932 0% /dev/shm
tmpfs 1890932 9120 1881812 1% /run
tmpfs 1890932 0 1890932 0% /sys/fs/cgroup
/dev/mapper/vgroot00-root 31441920 15637240 15804680 50% /
/dev/sda1 1038336 222332 816004 22% /boot
/dev/sdh1 20510332 45124 19416684 1% /SOFTWARE/DVD/18c
[root@OL4SAP001 DVD]#

Tip solutie



(0 din 6 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?