• vmware下linux 如何添加硬盘


    1.在虚拟机的设置中增加一块硬盘。
      setting -> add disk -> create a new virtual disk -> SCSI
      设定大小,这里给3G;更改名称,我这个硬盘用来安装Oracle ,名字为oradata.vmdk
    2.格式化硬盘。 
    [root@libydwei ~]# fdisk -l /dev/sdb
    
    Disk /dev/sdb: 2147 MB, 2147483648 bytes
    255 heads, 63 sectors/track, 261 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
    Disk /dev/sdb doesn't contain a valid partition table
    

      对硬盘进行格式化,这里不用指定分区类型,默认的linux就可以。

    [root@libydwei ~]# fdisk /dev/sdb
    
    Command (m for help): p
    
    Disk /dev/sdb: 2147 MB, 2147483648 bytes
    255 heads, 63 sectors/track, 261 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot Start End Blocks Id System
    
    Command (m for help): n
    Command action
       e extended
       p primary partition (1-4)
    p
    Partition number (1-4): q
    Partition number (1-4): 1
    First cylinder (1-261, default 1):
    Using default value 1
    Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
    Using default value 261
    
    Command (m for help): p
    
    Disk /dev/sdb: 2147 MB, 2147483648 bytes
    255 heads, 63 sectors/track, 261 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot Start End Blocks Id System
    /dev/sdb1 1 261 2096451 83 Linux
    
    Command (m for help):
    

      3.创建文件系统

    [root@libydwei ~]# mkfs.ext3 /dev/sdb1
    

      4.挂载分区。这里我们要将oracle 挂载在 /u01目录下。

    [root@libydwei ~]# mount -t ext3 /dev/sdb1 /u01
    [root@libydwei ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda2 3.9G 2.4G 1.3G 66% /
    /dev/sda1 46M 11M 33M 24% /boot
    none 252M 0 252M 0% /dev/shm
    /dev/sda3 7.0G 49M 6.6G 1% /home
    /dev/sdb1 2.0G 36M 1.9G 2% /u01
    [root@libydwei ~]#
    

      在文件fstab末尾添加     /dev/sdb1 /u01 ext3 defaults 0 0

    # This file is edited by fstab-sync - see 'man fstab-sync' for details
    LABEL=/ / ext3 defaults 1 1
    LABEL=/boot /boot ext3 defaults 1 2
    none /dev/pts devpts gid=5,mode=620 0 0
    none /dev/shm tmpfs defaults 0 0
    LABEL=/home /home ext3 defaults 1 2
    none /proc proc defaults 0 0
    none /sys sysfs defaults 0 0
    LABEL=SWAP-sda5 swap swap defaults 0 0
    # Beginning of the block added by the VMware software
    .host:/ /mnt/hgfs vmhgfs defaults,ttl=5 0 0
    # End of the block added by the VMware software
    /dev/hdc /media/cdrecorder auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
    /dev/fd0 /media/floppy auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
    
    /dev/sdb1 /u01 ext3 defaults 0 0
    

      

  • 相关阅读:
    修改linux的hostname (修改linux系统的IP和hostname)
    linux自动ftp上传与下载文件的简单脚本
    Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
    用SQL命令查看Mysql数据库大小
    linux screen 命令详解
    mysql常用命令
    Linux 设置mysql开机启动
    源码编译mysql 5.5+ 安装过程全记录
    nagios-plugins安装报错--with-mysql: no
    Spark 中在处理大批量数据排序问题时,如何避免OOM
  • 原文地址:https://www.cnblogs.com/Donal/p/4450827.html
Copyright © 2020-2023  润新知