1. 程式人生 > >給vmware的ubuntu虛擬機器增加硬碟、增加新的分割槽並自動掛載

給vmware的ubuntu虛擬機器增加硬碟、增加新的分割槽並自動掛載

[email protected]:/etc/init.d# 

把第二塊硬碟sdb的資訊加入到 /etc/fstab中,就可以自動掛載


[email protected]:/etc/init.d# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=7c76f0b7-85c4-4a27-9bf1-b7c2f3d4aa4e /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=0f42e1e0-a4cb-4b88-9d66-3281612cd77c none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
UUID=8767f1c9-3fa5-49ec-b18d-c2c8600abd34 /home/zhangbin/alex ext4 defaults 0 2



[email protected]:/etc/init.d# 
[email protected]:/etc/init.d# mount -t /dev/sda3 /home/zhangbin/zbhome
Usage: mount -V                 : print version
       mount -h                 : print this help
       mount                    : list mounted filesystems
       mount -l                 : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
       mount -a [-t|-O] ...     : mount all stuff from /etc/fstab
       mount device             : mount device at the known place
       mount directory          : mount known device here
       mount -t type dev dir    : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
       mount --bind olddir newdir
or move a subtree:
       mount --move olddir newdir
One can change the type of mount containing the directory dir:
       mount --make-shared dir
       mount --make-slave dir
       mount --make-private dir
       mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
       mount --make-rshared dir
       mount --make-rslave dir
       mount --make-rprivate dir
       mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using  -L label  or by uuid, using  -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say  man 8 mount .

=============

這次新增加一個分割槽







================

掛載一個新增加的分割槽到一個目錄下:

[email protected]:/etc/init.d# mount -t ext4 /dev/sda3 /home/zhangbin/zbhome
[email protected]:/etc/init.d# 

把這個命令加入到 /etc/rc.local


==============

這個文章還介紹了一個mount的封裝的py工具:

[sudo] password for zhangbin: 
[email protected]

:/home/zhangbin# apt-get install mountpy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  mountpy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.4 kB of archives.
After this operation, 98.3 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/universe mountpy i386 0.8.1 [12.4 kB]
Fetched 12.4 kB in 0s (21.8 kB/s)
Selecting previously unselected package mountpy.
(Reading database ... 566309 files and directories currently installed.)
Unpacking mountpy (from .../mountpy_0.8.1_i386.deb) ...
Processing triggers for man-db ...
Setting up mountpy (0.8.1) ...
[email protected]:/home/zhangbin# 
[email protected]:/home/zhangbin# 
[email protected]:/home/zhangbin# mountpy
/dev/sdb seems to be already mounted on /home/zhangbin/alex                    
/dev/sda3 seems to be already mounted on /home/zhangbin/zbhome                    
/dev/sda1 seems to be already mounted on /                    
Found nothing to mount                    
[email protected]:/home/zhangbin# gedit /etc/rc.local 
[email protected]:/home/zhangbin# 

相關推薦

vmware的ubuntu虛擬機器增加硬碟增加分割槽自動掛載

[email protected]:/etc/init.d#  把第二塊硬碟sdb的資訊加入到 /etc/fstab中,就可以自動掛載 [email protected]:/etc/init.d# cat /etc/fstab # /etc/

kvm虛擬機器增加磁碟

一,virsh attach-disk子命令 [[email protected] src]# virsh help attach-disk NAME attach-disk - attach disk device   SYNOPSIS attach

安裝虛擬機器的時候,記得分配虛擬機器硬碟大小不能太小

安裝虛擬機器的時候,記得分配給虛擬機器的硬碟大小不能太小 oracle vm,安裝系統的時候,一定不要把給虛擬機器的硬碟大小設定得過小,重要的截圖如下: 1.設定映象檔案,這裡的映象檔案最好選擇ghost的,不然會出現  no bootable medium found system

VirtualBox上的Ubuntu虛擬機器擴充套件硬碟空間

當初在virtualBox上安裝ubantu虛擬機器時,分割槽建議8g然後我就豪爽的給了25G,心想一定夠用!萬萬沒想到,我還是要開始折騰給虛擬機器擴充套件硬碟空間了! 步驟總的分兩步! (一) 新增虛擬硬碟 VitualBox 4.0以後,新增虛擬

修改Vmware Workstation虛擬機器物理硬碟序列號ID

有些軟體的註冊機制是根據物理硬碟序列號來作為唯一的識別符號。此序列號寫在硬碟的韌體裡面。一般的方法是無法修改此序列號的。 如果需要無限試用軟體可以讓軟體在虛擬機器內執行。試用期到了之後修改硬碟物理序列號好可以繼續試用。 修改方法: 用winhex開啟vmware-vmx.exe,如果是3

虛擬機器ubuntu硬碟擴容

首先需要關閉虛擬機器,選擇虛擬機器設定,點選硬碟,選擇擴充套件 經過上一步之後,硬碟就會增加新增的那麼多空間,但是是未分配的空間 網上有在Ubuntu下面使用gpatred工具 apt-get install gparted,更改根目錄的空間,測試過,

虛擬機器共享硬碟

我的博文永遠是辣麼簡略 1、安裝增強功能:虛擬機器操作如圖 2、在虛擬機器內出現如圖安裝程式:VBoxWindowsAdditions.exe即可安裝 3、設定階段: 虛擬機器設定裡找到共享資料夾: 雙擊然後修改成想要的目錄:1)別用手填;2)預設設定。 4、設定階段2

深入理解Java虛擬機器(四)EdenSurvivor老年代GC日誌

1. 年輕代 1.1 Eden區和Survivor區 新生代GC(Minor GC):指發生在新生代的垃圾收集動作,Minor GC非常頻繁,新生代採用複製演算法,一般回收速度也比較快。因為採用複製演算法,所以年輕代分為三部分:1個Eden區和2個Survivor區(分別叫Fro

使用虛擬機器對TelnetTCPFTPSMTPPOPHTTP進行分析

一、實驗環境  Windows Server 2008:DNS伺服器、Winmail郵件伺服器、Ser-U(FTP伺服器)  客戶機:Windows 7  網絡卡連線:NAT(Vmnet 8) 二、實驗步驟 1、設定IP地址    &

VirtualBox配置網絡卡實現:主機-虛擬機器互Ping聯網

1. 設定virtualbox網絡卡 查詢主機連線方式,也就是檢視使用網線還是wifi連線(主要是檢視描述名稱): 使用cmd視窗: ipconfig -all 橋接網絡卡-主機-虛擬機器通訊 通過上圖博主是使用網線連線,所以下圖選擇相應的介面名稱:

VMware虛擬機器新增硬碟

1.進入開啟終端,輸入:root 使用者fdisk –l 然後就可以看到已經發現了新的硬碟,大小為:2147MB。 然後輸入:fdisk  /dev/sdb 給新硬碟分割槽輸入n ,進行分割槽,依次輸入p,1 然後就一直回車。 2.當出現:Command (m for help

虛擬機器設定時區時間

date 檢視當前時間 安裝時間同步外掛yum install ntpdate 開啟時間同步service ntpdate restart 設定時區: 1)ntpdate time.nist.gov 與一個已知的時間伺服器同步 rm -rf /etc/loc

CentOS7虛擬機器安裝MysqlMysql報錯解決方案

一、安裝 首先在虛擬機器中安裝mysql,具體安裝在哪一個資料夾自己定義,樓主是在opt資料夾下安裝的 安裝mysql過程: 如果中間出現問題,可以嘗試解除安裝mysql,然後重新安裝 解除安裝mysql: 二、啟動 1.首先啟動Mysql,看看是否已經安

VMWare搭多臺虛擬機器做叢集負載均衡主從資料庫一

最近一時興起,想搭建幾臺虛擬機器做負載均衡和資料庫主從等高階功能研究。不做安全性和其它考慮。這裡主要是為了以後測試高階的功能。 目前的想法是實現下面幾個功能: 1、負載均衡服務,能承受大量的併發訪問 2、分存式快取,以後多的東西肯定放快取裡面。 3、主從資料庫或者資料庫讀

OO ALV 事件詳細使用(增加按鈕增加下拉框等)

report  Z_OOALV. type-pools: icon. class lcl_event_receiver definition deferred. tables: sflight. data:       gi_index_rows type lvc_t_ro

jvm虛擬機器組成部分講解jvm虛擬機器引數使用講解併發程式設計框架篇

package com.bjsxt.base001; public class Test01 { public static void main(String[] args) { //-Xms5m -Xmx20m -XX:+PrintGCDetails -XX:+UseSerialGC

【Java虛擬機器】3虛擬機器物件

--------------------------------【Java虛擬機器】系列-------------------------------- 1、Java技術體系 2、Java記憶體區域 3、虛擬機器物件 4、OutOfMemoryError異常 -

在宿主機上通過NAT模式kvm虛擬機器配置公網IP

宿主機只有一個外網IP的時候,使用NAT(網路地址轉換)模式讓虛擬系統通過宿主機器所在的網路來訪問公網。 KVM虛擬機器Nat方式上網步驟: 1.確保宿主機能通外網 2.檢視當前活躍網路,可以看到

[深入理解Java虛擬機器] 第45章 效能監控與調優

文章目錄 JDK的命令列工具 jps:虛擬機器程序狀況工具 jstat:虛擬機器統計資訊監視工具 jinfo:Java配置資訊工具 jmap:Java記憶體映像工具 jhat:虛擬機器堆轉儲快照分

【Java虛擬機器】4OutOfMemoryError異常

--------------------------------【Java虛擬機器】系列-------------------------------- 1、Java技術體系 2、Java記憶體區域 3、虛擬機器物件 4、OutOfMemoryError異常 -