Virtual Machine Disk Expansion

Source: Internet
Author: User

Problem describe: Virtual machine, insufficient disk space, add hard disk, partition, format, mount, boot automatically mount.


[Email protected] ~]# Cd/dev
[[email protected] dev]# ls
Agpgart log pts sda3 tty19 tty42 Tty9
AutoFS loop0 ram0 sda4 tty2 tty43 ttyS0
Block Loop1 ram1 sda5 tty20 tty44 ttyS1
BSG Loop2 ram10 sdb tty21 tty45 ttyS2
Btrfs-control loop3 ram11 sg0 tty22 tty46 ttyS3
CDROM loop4 ram12 SG1 tty23 tty47 uinput
CDRW loop5 ram13 sg2 tty24 tty48 urandom
Char loop6 ram14 SHM tty25 tty49 usbmon0
Console loop7 ram15 snapshot tty26 tty5 vcs
Core Lp0 ram2 sr0 tty27 tty50 vcs1
CPU LP1 ram3 stderr tty28 tty51 vcs2
Cpu_dma_latency lp2 ram4 stdin tty29 tty52 VCS3
Crash lp3 ram5 stdout tty3 tty53 vcs4
Disk Makedev ram6 systty tty30 tty54 VCS5
DVD mapper Ram7 TTY tty31 tty55 VCS6
DVDRW mcelog ram8 tty0 tty32 tty56 VCSA
FB mem ram9 tty1 tty33 tty57 VCSA1
fb0 net random tty10 tty34 tty58 VCSA2
FD network_latency Raw tty11 tty35 tty59 VCSA3
Full network_throughput root tty12 tty36 tty6 vcsa4
Fuse NULL RTC TTY13 tty37 tty60 VCSA5
Hpet nvram rtc0 tty14 tty38 tty61 vcsa6
Hugepages oldmem scd0 tty15 tty39 tty62 vga_arbiter
HVC0 Port SDA tty16 tty4 tty63 Zero
Input PPP sda1 TTY17 tty40 tty7
Kmsg ptmx sda2 tty18 tty41 tty8
[email protected] dev]# ll SDB
BRW-RW----. 1 root disk 8, 16 October 01:29 SDB
[Email protected] dev]# Fdisk/dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF Disklabel
Building a new DOS disklabel with disk identifier 0x11951286.
Changes'll remain in memory only, until the decide to write them.
After that, of course, the previous content won ' t is recoverable.

Warning:invalid flag 0x0000 of partition Table 4 would be a corrected by W (rite)

Warning:dos-compatible mode is deprecated. It ' s strongly recommended to
Switch off the mode (command ' C ') and change display units to
Sectors (Command ' u ').

Command (M for help): N
Command Action
E Extended
P primary partition (1-4)
P
Partition number (1-4): 1
First cylinder (1-2610, default 1): 1
Last cylinder, +cylinders or +size{k,m,g} (1-2610, default 2610):
Using Default Value 2610

Command (M for help): W
The partition table has been altered!

Calling IOCTL () to re-read partition table.
Syncing disks.
[Email protected] dev]# MKFS/DEV/SDB1
MKE2FS 1.41.12 (17-may-2010)
File System label =
Operating system: Linux
Block size =4096 (log=2)
Chunked size =4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the Super user
First block of data =0
Maximum filesystem blocks=4294967296
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,
4096000

Writing Inode table: complete
Writing Superblocks and FileSystem accounting information: Complete

This filesystem would be automatically checked every mounts or
Whichever comes first. Use Tune2fs-c or-i to override.
[email protected] dev]# LL
Total dosage 0
CRW-RW----. 1 root video 10, 175 October 01:29 Agpgart
CRW-RW----. 1 root root 10, 57 October 01:29 AutoFS
Drwxr-xr-x. 2 root root 700 October 01:31 block
Drwxr-xr-x. 2 root root 100 October 01:29 BSG
CRW-------. 1 root root 10, 234 October 01:29 Btrfs-control
lrwxrwxrwx. 1 root root 3 October 01:29 cdrom-sr0
lrwxrwxrwx. 1 root root 3 October 01:29 CDRW-sr0
Drwxr-xr-x. 2 root root 2560 October 01:29 Char
CRW-------. 1 root root 5, 1 October 01:29 console
lrwxrwxrwx. 1 root root 11 October 01:29 Core--/proc/kcore
Drwxr-xr-x. 3 root root 80 October 01:29 CPU
CRW-RW----. 1 root root 10, 61 October 01:29 Cpu_dma_latency
CRW-RW----. 1 root root 10, 62 October 01:29 crash
Drwxr-xr-x. 6 root root 120 October 01:29 disk
lrwxrwxrwx. 1 root root 3 October 01:29 DVD-Sr0
lrwxrwxrwx. 1 root root 3 October 01:29 DVDRW-sr0
lrwxrwxrwx. 1 root root 3 October 01:29 FB--fb0
CRW-RW----. 1 root root 29, 0 October 01:29 fb0
lrwxrwxrwx. 1 root root 13 October 01:29 FD--/PROC/SELF/FD
crw-rw-rw-. 1 root root 1, 7 October 01:29 full
crw-rw-rw-. 1 root root 10, 229 October 01:29 Fuse
CRW-RW----. 1 root root 10, 228 October 01:29 Hpet
Drwxr-xr-x. 2 root root 40 October 01:29 hugepages
CRW-------. 1 root root 229, 0 October 01:29 hvc0
Drwxr-xr-x. 3 root root 200 October 01:29 input
CRW-RW----. 1 root root 1, 11 October 01:29 kmsg
srw-rw-rw-. 1 root root 0 October 01:29 log
BRW-RW----. 1 root disk 7, 0 October 01:29 loop0
BRW-RW----. 1 root disk 7, 1 October 01:29 LOOP1
BRW-RW----. 1 root disk 7, 2 October 01:29 LOOP2
BRW-RW----. 1 root disk 7, 3 October 01:29 LOOP3
BRW-RW----. 1 root disk 7, 4 October 01:29 LOOP4
BRW-RW----. 1 root disk 7, 5 October 01:29 LOOP5
BRW-RW----. 1 root disk 7, 6 October 01:29 LOOP6
BRW-RW----. 1 root disk 7, 7 October 01:29 LOOP7
CRW-RW----. 1 Root LP 6, 0 October 01:29 lp0
CRW-RW----. 1 root LP 6, 1 October 01:29 LP1
CRW-RW----. 1 root LP 6, 2 October 01:29 LP2
CRW-RW----. 1 root LP 6, 3 October 01:29 LP3
lrwxrwxrwx. 1 root root 13 October 01:29 Makedev-/sbin/makedev
Drwxr-xr-x. 2 root root 60 October 01:29 Mapper
CRW-RW----. 1 root root 10, 227 October 01:29 Mcelog
Crw-r-----. 1 root kmem 1, 1 October 01:29 mem
Drwxr-xr-x. 2 root root 60 October 01:29 Net
CRW-RW----. 1 root root 10, 60 October 01:29 network_latency
CRW-RW----. 1 root root 10, 59 October 01:29 Network_throughput
crw-rw-rw-. 1 root root 1, 3 October 01:29 null
Crw-r-----. 1 root kmem 10, 144 October 01:29 NVRAM
CRW-RW----. 1 root root 1, 12 October 01:29 Oldmem
Crw-r-----. 1 root kmem 1, 4 October 01:29 Port
CRW-------. 1 root root 108, 0 October 01:29 PPP
crw-rw-rw-. 1 root TTY 5, 2 October 01:31 PTMX
Drwxr-xr-x. 2 root root 0 October 01:29 pts
BRW-RW----. 1 root Disk 1, 0 October 01:29 ram0
BRW-RW----. 1 root Disk 1, 1 October 01:29 ram1
BRW-RW----. 1 root Disk 1, 10 October 01:29 RAM10
BRW-RW----. 1 root Disk 1, 11 October 01:29 RAM11
BRW-RW----. 1 root Disk 1, 12 October 01:29 RAM12
BRW-RW----. 1 root Disk 1, 13 October 01:29 Ram13
BRW-RW----. 1 root Disk 1, 14 October 01:29 Ram14
BRW-RW----. 1 root Disk 1, 15 October 01:29 RAM15
BRW-RW----. 1 root Disk 1, 2 October 01:29 ram2
BRW-RW----. 1 root Disk 1, 3 October 01:29 RAM3
BRW-RW----. 1 root Disk 1, 4 October 01:29 ram4
BRW-RW----. 1 root Disk 1, 5 October 01:29 RAM5
BRW-RW----. 1 root Disk 1, 6 October 01:29 RAM6
BRW-RW----. 1 root Disk 1, 7 October 01:29 ram7
BRW-RW----. 1 root Disk 1, 8 October 01:29 RAM8
BRW-RW----. 1 root Disk 1, 9 October 01:29 ram9
crw-rw-rw-. 1 root root 1, 8 October 01:29 random
Drwxr-xr-x. 2 root root 60 October 01:29 Raw
lrwxrwxrwx. 1 root root 4 October 01:29 root-Sda5
lrwxrwxrwx. 1 root root 4 October 01:29 RTC--RTC0
CRW-RW----. 1 root root 254, 0 October 01:29 rtc0
lrwxrwxrwx. 1 root root 3 October 01:29 scd0-sr0
BRW-RW----. 1 root disk 8, 0 October 01:29 SDA
BRW-RW----. 1 root disk 8, 1 October 01:29 sda1
BRW-RW----. 1 root disk 8, 2 October 01:29 sda2
BRW-RW----. 1 root disk 8, 3 October 01:29 Sda3
BRW-RW----. 1 root disk 8, 4 October 01:29 sda4
BRW-RW----. 1 root disk 8, 5 October 01:29 Sda5
BRW-RW----. 1 root disk 8, 16 October 01:31 SDB
BRW-RW----. 1 root disk 8, 17 October 01:31 SDB1
CRW-RW----. 1 root disk 21, 0 October 01:29 sg0
CRW-RW----. 1 root disk 21, 1 October 01:29 SG1
CRW-RW----. 1 root CDROM 21, 2 October 01:29 SG2
DRWXRWXRWT. 2 root root 80 October 01:30 SHM
CRW-RW----. 1 root root 10, 231 October 01:29 Snapshot
BRW-RW----+ 1 root cdrom 11, 0 October 01:29 sr0
lrwxrwxrwx. 1 root root 15 October 01:29 stderr-/PROC/SELF/FD/2
lrwxrwxrwx. 1 root root 15 October 01:29 stdin-/proc/self/fd/0
lrwxrwxrwx. 1 root root 15 October 01:29 stdout-/PROC/SELF/FD/1
lrwxrwxrwx. 1 root root 4 October 01:29 Systty-tty0
crw-rw-rw-. 1 root TTY 5, 0 October 01:29 TTY
Crw--w----. 1 root TTY 4, 0 October 01:29 tty0
Crw--w----. 1 root TTY 4, 1 October 01:29 tty1
Crw--w----. 1 root TTY 4, 10 October 01:29 Tty10
Crw--w----. 1 root TTY 4, 11 October 01:29 Tty11
Crw--w----. 1 root TTY 4, 12 October 01:29 Tty12
Crw--w----. 1 root TTY 4, 13 October 01:29 TTY13
Crw--w----. 1 root TTY 4, 14 October 01:29 TTY14
Crw--w----. 1 root TTY 4, 15 October 01:29 TTY15
Crw--w----. 1 root TTY 4, 16 October 01:29 TTY16
Crw--w----. 1 root TTY 4, 17 October 01:29 TTY17
Crw--w----. 1 root TTY 4, 18 October 01:29 Tty18
Crw--w----. 1 root TTY 4, 19 October 01:29 Tty19
CRW-------. 1 root root 4, 2 October 01:29 Tty2
Crw--w----. 1 root TTY 4, 20 October 01:29 Tty20
Crw--w----. 1 root TTY 4, 21 October 01:29 Tty21
Crw--w----. 1 root TTY 4, 22 October 01:29 Tty22
Crw--w----. 1 root TTY 4, 23 October 01:29 tty23
Crw--w----. 1 root TTY 4, 24 October 01:29 tty24
Crw--w----. 1 root TTY 4, 25 October 01:29 tty25
Crw--w----. 1 root TTY 4, 26 October 01:29 tty26
Crw--w----. 1 root TTY 4, 27 October 01:29 tty27
Crw--w----. 1 root TTY 4, 28 October 01:29 tty28
Crw--w----. 1 root TTY 4, 29 October 01:29 Tty29
CRW-------. 1 root root 4, 3 October 01:29 tty3
Crw--w----. 1 root TTY 4, 30 October 01:29 tty30
Crw--w----. 1 root TTY 4, 31 October 01:29 tty31
Crw--w----. 1 root TTY 4, 32 October 01:29 tty32
Crw--w----. 1 root TTY 4, 33 October 01:29 tty33
Crw--w----. 1 root TTY 4, 34 October 01:29 Tty34
Crw--w----. 1 root TTY 4, 35 October 01:29 tty35
Crw--w----. 1 root TTY 4, 36 October 01:29 tty36
Crw--w----. 1 root TTY 4, 37 October 01:29 tty37
Crw--w----. 1 root TTY 4, 38 October 01:29 tty38
Crw--w----. 1 root TTY 4, 39 October 01:29 tty39
CRW-------. 1 root root 4, 4 October 01:29 Tty4
Crw--w----. 1 root TTY 4, 40 October 01:29 tty40
Crw--w----. 1 root TTY 4, 41 October 01:29 tty41
Crw--w----. 1 root TTY 4, 42 October 01:29 tty42
Crw--w----. 1 root TTY 4, 43 October 01:29 tty43
Crw--w----. 1 root TTY 4, 44 October 01:29 tty44
Crw--w----. 1 root TTY 4, 45 October 01:29 tty45
Crw--w----. 1 root TTY 4, 46 October 01:29 tty46
Crw--w----. 1 root TTY 4, 47 October 01:29 tty47
Crw--w----. 1 root TTY 4, 48 October 01:29 Tty48
Crw--w----. 1 root TTY 4, 49 October 01:29 tty49
CRW-------. 1 root root 4, 5 October 01:29 tty5
Crw--w----. 1 root TTY 4, 50 October 01:29 tty50
Crw--w----. 1 root TTY 4, 51 October 01:29 tty51
Crw--w----. 1 root TTY 4, 52 October 01:29 tty52
Crw--w----. 1 root TTY 4, 53 October 01:29 tty53
Crw--w----. 1 root TTY 4, 54 October 01:29 tty54
Crw--w----. 1 root TTY 4, 55 October 01:29 tty55
Crw--w----. 1 root TTY 4, 56 October 01:29 tty56
Crw--w----. 1 root TTY 4, 57 October 01:29 tty57
Crw--w----. 1 root TTY 4, 58 October 01:29 tty58
Crw--w----. 1 root TTY 4, 59 October 01:29 tty59
CRW-------. 1 root root 4, 6 October 01:29 Tty6
Crw--w----. 1 root TTY 4, 60 October 01:29 tty60
Crw--w----. 1 root TTY 4, 61 October 01:29 tty61
Crw--w----. 1 root TTY 4, 62 October 01:29 tty62
Crw--w----. 1 root TTY 4, 63 October 01:29 tty63
Crw--w----. 1 root TTY 4, 7 October 01:29 Tty7
Crw--w----. 1 root TTY 4, 8 October 01:29 tty8
Crw--w----. 1 root TTY 4, 9 October 01:29 Tty9
CRW-RW----. 1 root dialout 4, 64 October 01:29 ttyS0
CRW-RW----. 1 root dialout 4, 65 October 01:29 ttyS1
CRW-RW----. 1 root dialout 4, 66 October 01:29 TtyS2
CRW-RW----. 1 root dialout 4, 67 October 01:29 TtyS3
Crw-r-----. 1 root root 10, 223 October 01:29 Uinput
crw-rw-rw-. 1 root root 1, 9 October 01:29 urandom
CRW-RW----. 1 root root 250, 0 October 01:29 Usbmon0
CRW-RW----. 1 VCSA TTY 7, 0 October 01:29 VCs
CRW-RW----. 1 VCSA TTY 7, 1 October 01:29 VCS1
CRW-RW----. 1 VCSA TTY 7, 2 October 01:29 VCS2
CRW-RW----. 1 VCSA TTY 7, 3 October 01:29 VCS3
CRW-RW----. 1 VCSA TTY 7, 4 October 01:29 VCS4
CRW-RW----. 1 VCSA TTY 7, 5 October 01:29 VCS5
CRW-RW----. 1 VCSA TTY 7, 6 October 01:29 VCS6
CRW-RW----. 1 VCSA TTY 7, 128 October 01:29 VCSA
CRW-RW----. 1 VCSA TTY 7, 129 October 01:29 VCSA1
CRW-RW----. 1 VCSA TTY 7, 130 October 01:29 VCSA2
CRW-RW----. 1 VCSA TTY 7, 131 October 01:29 VCSA3
CRW-RW----. 1 VCSA TTY 7, 132 October 01:29 VCSA4
CRW-RW----. 1 VCSA TTY 7, 133 October 01:29 VCSA5
CRW-RW----. 1 VCSA TTY 7, 134 October 01:29 VCSA6
CRW-RW----. 1 root root 10, 63 October 01:29 Vga_arbiter
crw-rw-rw-. 1 root root 1, 5 October 01:29 Zero
[Email protected] dev]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda5 14G 12G 1.9G 86%/
Tmpfs 750M 72K 750M 1%/DEV/SHM
/DEV/SDA1 190M 36M 145M 20%/boot
/dev/sda3 1.9G 9.4M 1.8G 1%/tmp
[[email protected] dev]# ls
Agpgart log pts sda3 Tty18 tty41 tty8
AutoFS loop0 ram0 sda4 tty19 tty42 tty9
Block Loop1 ram1 sda5 tty2 tty43 ttyS0
BSG Loop2 ram10 sdb tty20 tty44 ttyS1
Btrfs-control loop3 ram11 sdb1 tty21 tty45 ttyS2
CDROM loop4 ram12 sg0 tty22 tty46 ttyS3
CDRW loop5 ram13 SG1 tty23 tty47 uinput
Char loop6 ram14 SG2 tty24 tty48 urandom
Console LOOP7 ram15 shm tty25 tty49 usbmon0
Core lp0 ram2 Snapshot tty26 tty5 vcs
CPU LP1 ram3 sr0 tty27 tty50 vcs1
Cpu_dma_latency lp2 ram4 stderr tty28 tty51 vcs2
Crash lp3 ram5 stdin tty29 tty52 VCS3
Disk Makedev ram6 stdout tty3 tty53 vcs4
DVD Mapper Ram7 systty tty30 tty54 VCS5
DVDRW mcelog ram8 TTY tty31 tty55 VCS6
FB mem ram9 tty0 tty32 tty56 VCSA
fb0 net random tty1 tty33 tty57 VCSA1
FD network_latency Raw tty10 tty34 tty58 VCSA2
Full network_throughput root tty11 tty35 tty59 vcsa3
Fuse NULL RTC TTY12 tty36 TTY6 VCSA4
Hpet nvram rtc0 tty13 tty37 tty60 vcsa5
Hugepages oldmem scd0 tty14 tty38 tty61 vcsa6
HVC0 Port SDA tty15 tty39 tty62 vga_arbiter
Input PPP sda1 TTY16 tty4 tty63 Zero
Kmsg ptmx sda2 tty17 tty40 tty7
[Email protected] dev]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda5 14G 12G 1.9G 86%/
Tmpfs 750M 72K 750M 1%/DEV/SHM
/DEV/SDA1 190M 36M 145M 20%/boot
/dev/sda3 1.9G 9.4M 1.8G 1%/tmp
[[Email protected] dev]# CD/
[Email protected]/]# mkdir u02
[[email protected]/]# ls
Bin Dev Home lib64 media mnt opt root selinux sys u02 var
Boot etc lib Lost+found misc net proc sbin srv tmp usr
[Email protected]/]# rm-r u02
RM: Do you want to delete the directory "u02"? Y
[Email protected]/]# mkdir u01
[[email protected]/]# ls
Bin Dev Home lib64 media mnt opt root selinux sys u01 var
Boot etc lib Lost+found misc net proc sbin srv tmp usr
[Email protected]/]# mount/dev/sdb1/u01
[Email protected]/]# df-h
Filesystem Size used Avail use% mounted on
/dev/sda5 14G 12G 1.9G 86%/
Tmpfs 750M 72K 750M 1%/DEV/SHM
/DEV/SDA1 190M 36M 145M 20%/boot
/dev/sda3 1.9G 9.4M 1.8G 1%/tmp
/DEV/SDB1 20G 44M 19G 1%/u01

[Email protected]/]# chown oracle:oinstall/u01

And then we need to get the boot automatically mounted.

Virtual Machine Disk Expansion

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.