VMWare - Mount windows shared on Oracle Linux (OEL) Guest OS
[root@oel65 ~]# mount -t cifs -o username=*****,password=***** //192.168.XXX.XXX/shared_vm /mnt/shared
[root@oel65 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 11G 4.0G 5.9G 41% /
tmpfs 3.0G 264K 3.0G 1% /dev/shm
/dev/sda1 485M 54M 406M 12% /boot
//192.168.210.1/shared_vm 465G 150G 316G 33% /mnt/stage
Vmware - Linux Guest - Add a New Hard Disk Without Rebooting Guest
Add new disk (scsi) using vmware (while guest running)
(*** Please notice only scsi disk allow operation while power on. ***)
[root@oel65 ~]# ls -lrt /dev/sdc*
ls: cannot access /dev/sdc*: No such file or directory
[root@oel65 ~]# ls /sys/class/scsi_host/
host0 host1 host2
[root@oel65 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan
[root@oel65 ~]# ls -lrt /dev/sdc*
brw-rw----. 1 root disk 8, 16 Sep 25 13:11 /dev/sdc
One can use below commands to use new disk
fdisk /dev/sdc
mkfs.ext3 /dev/sdc3
mkdir /disk3
mount -t ext3 /dev/sdc3 /disk3
umount /dev/sdc3
How to remove Single Device /dev/sdc ?
[root@oel65 ~]# ls -lrt /dev/sdc*
brw-rw----. 1 root disk 8, 16 Sep 25 13:11 /dev/sdc
[root@oel65 ~]# echo 1 > /sys/block/sdc/device/delete
[root@oel65 ~]# ls -lrt /dev/sdc*
ls: cannot access /dev/sdc*: No such file or directory
Disk Partition and adding space to an existing Linux Volume
[root@oel65 ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 11G 4.0G 5.9G 41% /
[root@oel65 ~]# ls -lrt /dev/sd*
brw-rw----. 1 root disk 8, 0 Sep 25 13:11 /dev/sda
brw-rw----. 1 root disk 8, 16 Sep 25 13:11 /dev/sdb
brw-rw----. 1 root disk 8, 2 Sep 25 13:11 /dev/sda2
brw-rw----. 1 root disk 8, 1 Sep 25 13:11 /dev/sda1
[root@oel65 ~]# 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 0x1ce3c258.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be 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): p
Disk /dev/sdb: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1ce3c258
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): 1
First cylinder (1-3263, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-3263, default 3263):
Using default value 3263
Command (m for help): p
Disk /dev/sdb: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1ce3c258
Device Boot Start End Blocks Id System
/dev/sdb1 1 3263 26210016 83 Linux
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L
0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
1 FAT12 39 Plan 9 82 Linux swap / So c1 DRDOS/sec (FAT-
2 XENIX root 3c PartitionMagic 83 Linux c4 DRDOS/sec (FAT-
3 XENIX usr 40 Venix 80286 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
4 FAT16 <32M 41 PPC PReP Boot 85 Linux extended c7 Syrinx
5 Extended 42 SFS 86 NTFS volume set da Non-FS data
6 FAT16 4d QNX4.x 87 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4e QNX4.x 2nd part 88 Linux plaintext de Dell Utility
8 AIX 4f QNX4.x 3rd part 8e Linux LVM df BootIt
9 AIX bootable 50 OnTrack DM 93 Amoeba e1 DOS access
a OS/2 Boot Manag 51 OnTrack DM6 Aux 94 Amoeba BBT e3 DOS R/O
b W95 FAT32 52 CP/M 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs
e W95 FAT16 (LBA) 54 OnTrackDM6 a5 FreeBSD ee GPT
f W95 Ext'd (LBA) 55 EZ-Drive a6 OpenBSD ef EFI (FAT-12/16/
10 OPUS 56 Golden Bow a7 NeXTSTEP f0 Linux/PA-RISC b
11 Hidden FAT12 5c Priam Edisk a8 Darwin UFS f1 SpeedStor
12 Compaq diagnost 61 SpeedStor a9 NetBSD f4 SpeedStor
14 Hidden FAT16 <3 63 GNU HURD or Sys ab Darwin boot f2 DOS secondary
16 Hidden FAT16 64 Novell Netware af HFS / HFS+ fb VMware VMFS
17 Hidden HPFS/NTF 65 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 70 DiskSecure Mult b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 75 PC/IX bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 80 Old Minix be Solaris boot ff BBT
1e Hidden W95 FAT1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@oel65 ~]# ls -lrt /dev/sdb*
brw-rw----. 1 root disk 8, 16 Sep 25 15:15 /dev/sdb
brw-rw----. 1 root disk 8, 17 Sep 25 15:15 /dev/sdb1
[root@oel65 ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup
PV Size 22.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 5762
Free PE 0
Allocated PE 5762
PV UUID mdlQ1P-eGJ9-P1B9-nqrx-bMBR-3y9B-AWYm9W
**If I would have been increased size of sda (disk)**then only below two command needed.
pvresize /dev/sda2
lvextend -l +100%FREE /dev/VolGroup/lv_root
As I have added new disk and want to add this disk space to an existing volume group, so here you go..
[root@oel65 ~]# vgdisplay
--- Volume group ---
VG Name VolGroup
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 22.51 GiB
PE Size 4.00 MiB
Total PE 5762
Alloc PE / Size 5762 / 22.51 GiB
Free PE / Size 0 / 0
VG UUID qM0KEH-9HNA-Hbs0-FcXd-xauD-KU1l-pm9XpP
[root@oel65 ~]# lvdisplay
--- Logical volume ---
LV Path /dev/VolGroup/lv_root
LV Name lv_root
VG Name VolGroup
LV UUID zlM0mG-oavS-2CH6-B3Ct-oAEN-zJW4-3Jab0z
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2014-09-24 14:05:18 +0100
LV Status available
# open 1
LV Size 10.51 GiB
Current LE 2690
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0
--- Logical volume ---
LV Path /dev/VolGroup/lv_swap
LV Name lv_swap
VG Name VolGroup
LV UUID bOFGL5-3jrz-03z1-TAai-F3Zf-2OpN-wqBPqP
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2014-09-24 14:05:20 +0100
LV Status available
# open 2
LV Size 12.00 GiB
Current LE 3072
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1
[root@oel65 ~]# pvcreate /dev/sdb1 <<< Creating a New Physical Volume with the New Disk Image
Physical volume "/dev/sdb1" successfully created
[root@oel65 ~]# vgscan <<< Extending the Volume Group with the New Physical Disk
Reading all physical volumes. This may take a while...
Found volume group "VolGroup" using metadata type lvm2
[root@oel65 ~]# vgextend VolGroup /dev/sdb1
Volume group "VolGroup" successfully extended
[root@oel65 ~]# lvscan <<< Extending the Logical Volume with the New Volume Group
ACTIVE '/dev/VolGroup/lv_root' [10.51 GiB] inherit
ACTIVE '/dev/VolGroup/lv_swap' [12.00 GiB] inherit
[root@oel65 ~]# lvextend -l +100%FREE /dev/VolGroup/lv_root
Extending logical volume lv_root to 35.50 GiB
Logical volume lv_root successfully resized
[root@oel65 ~]# resize2fs /dev/VolGroup/lv_root <<< Resizing the File System
resize2fs 1.43-WIP (20-Jun-2013)
Filesystem at /dev/VolGroup/lv_root is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 3
Performing an on-line resize of /dev/VolGroup/lv_root to 9306112 (4k) blocks.
The filesystem on /dev/VolGroup/lv_root is now 9306112 blocks long.
[root@oel65 ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 35G 4.0G 30G 13% /