【小貼士】RedHat虛擬機器mount新硬碟
命令易忘,好記性不如爛筆頭,於是記下以備後用。
1.虛擬機器格式化新硬碟出來,在筆記本上在行動硬碟上劃出18G的空間出來,結果花了我大概三個小時。
此虛擬硬碟作為IDE Slave。
2.透過fdisk -l可以看到/dev/hdb就是新增的硬碟,還未格式化。
: / > fdisk -l
Disk /dev/hda: 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/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2610 20860402+ 8e Linux LVM
Disk /dev/hdb: 17.1 GB, 17179869184 bytes
16 heads, 63 sectors/track, 33288 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk /dev/hdb doesn't contain a valid partition table
3.再用fdisk對其進行分割槽
: /mnt > fdisk /dev/hdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 33288.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-33288, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-33288, default 33288):
Using default value 33288
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
這時可以看到新硬碟分割槽成功。
: /mnt > fdisk -l
Disk /dev/hda: 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/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 2610 20860402+ 8e Linux LVM
Disk /dev/hdb: 17.1 GB, 17179869184 bytes
16 heads, 63 sectors/track, 33288 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 33288 16777120+ 83 Linux
4.使用mkfs.ext3命令格式化該分割槽
: /mnt > mkfs.ext3 /dev/hdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2097152 inodes, 4194280 blocks
209714 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
128 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
5.mount到你想要的地方:)
: /mnt > mkdir -p /disk2
: /mnt > mount /dev/hdb1 /disk2
: /mnt > df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
18G 13G 3.7G 78% /
/dev/hda1 99M 11M 84M 12% /boot
tmpfs 1.0G 0 1.0G 0% /dev/shm
/dev/hdb1 16G 173M 15G 2% /disk2
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15415488/viewspace-616184/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 虛擬機器Ubuntu 掛載硬碟虛擬機Ubuntu硬碟
- 安裝虛擬Redhat Linux,物理硬碟與虛擬硬碟共存的問題(轉)RedhatLinux硬碟
- vm虛擬機器改變硬碟大小虛擬機硬碟
- windows下vmware虛擬機器擴充硬碟Windows虛擬機硬碟
- 虛擬機器 redhat 6.5 oracle11g RAC虛擬機RedhatOracle
- vmware克隆虛擬機器centos6.5,虛擬機器從新配置虛擬機CentOS
- RedHat虛擬機器打不開磁碟問題如何解決?RedHat虛擬機器打不開磁碟的解決方法Redhat虛擬機
- 轉:虛擬機器中為Linux新增硬碟虛擬機Linux硬碟
- 建立Azure DS 虛擬機器並附加SSD硬碟虛擬機硬碟
- Dalvik虛擬機器、Java虛擬機器與ART虛擬機器虛擬機Java
- 為虛擬機器新增硬碟並進行分割槽虛擬機硬碟
- 調整vmware虛擬機器硬碟空間的方法虛擬機硬碟
- 【Cron表示式】小貼士
- Mac VirtualBox 7.0 下安裝Redhat 8.5虛擬機器MacRedhat虛擬機
- 虛擬機器中RedHat AS4U2安裝Oracle虛擬機RedhatOracle
- 25個Linux 伺服器安全小貼士Linux伺服器
- java虛擬機器和Dalvik虛擬機器Java虛擬機
- Android 虛擬機器 Vs Java 虛擬機器Android虛擬機Java
- redhat 5下如何mount光碟機Redhat
- 虛擬機器虛擬機
- 虛擬機器Centos安裝docker小記虛擬機CentOSDocker
- 連線虛擬機器oracle 和虛擬機器KEY虛擬機Oracle
- 虛擬機器(三)虛擬機器配置靜態Ip虛擬機
- RedHat新加硬碟的方法Redhat硬碟
- Ubuntu——每日小貼士:Linux上的時光機UbuntuLinux
- 如何不用重啟在CentOS 7/ RHEL 7虛擬機器中新增一塊新硬碟CentOS虛擬機硬碟
- VirtualBox如何擴充套件虛擬機器Ubuntu的硬碟容量套件虛擬機Ubuntu硬碟
- PD虛擬機器 18 for Mac(Mac虛擬機器軟體)虛擬機Mac
- 減小VirtualBox虛擬硬碟檔案的大小硬碟
- JVM 虛擬機器JVM虛擬機
- JVM虛擬機器JVM虛擬機
- Neo 虛擬機器虛擬機
- VMware虛擬機器虛擬機
- 前端體驗優化小貼士前端優化
- .Net網頁開發小貼士網頁
- 虛擬機器arm虛擬環境搭建虛擬機
- Windows 8將整合虛擬光碟機/硬碟功能Windows硬碟
- 搭建測試環境exadata一體機 (vm虛擬機器redhat上配置)虛擬機Redhat