发新话题
打印

Linux系统下安装第二块硬盘-适用于VMWare

Linux系统下安装第二块硬盘-适用于VMWare

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

1) Create one or more partitions using f。disk:
f。disk  /dev/sdb
N (new partition)
p (primary partition)

Accept default initial and end blocks if you want to create a single partiton with the whole disk

w (write the information and quit)

2) check the new partition

[@vmractest3 ]# f。disk -l
Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sdb1             1      2610  20964793+  83  Linux

3) Format the new partition as an ext3 file system type:

/sbin/mkfs -t ext4 /dev/sdb1

4)Assigning a Label with e2label

Once you have created and formated a partition,

you should assign it a label using the e2label command. This allows you

to add the partition to /e。tc/fstab using a label instead of using a

device path, thereby making the system more robust. [1] To add a label

to a partition, type the following command as :

/sbin/e2label /dev/sdb1 /oradisk

5) Then add the new partition to /e。tc/fstab, this way it will be mounted at reboot:

To check the label use this command:

[@vmractest3 ]# /sbin/tune2fs -l /dev/sdb1 |grep volume

Filesystem volume name:   /oradisk

vi /e。tc/fstab and add the following line:

LABEL=/oradisk          /oradisk                ext3    defaults        1 2

6) Mount the new file system:

First create the base directory and assign it to the user that will own it

[@vmractest3 ]# mkdir /oradisk

[@vmractest3 ]#c。hown oracle:dba /oradisk

Then mount it

[@vmractest3 ]# m。ount /dev/sdb1 /oradisk

And check it

[@vmractest3 ]# df -k

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda2              8064304   2181296   5473352  29% /

/dev/sda1               101089      9272     86598  10% /boot

none                    513748         0    513748   0% /dev/shm

/dev/sdb1             20635700     32828  19554636   1% /oradisk

原文: https://blogs.oracle.com/alejandrovargas/how-to-create,-configure-and-mount-a-new-linux-file-system

TOP

发新话题