OL 4 MySQL: Extending my VM’s root f/s online

Ok, so after all the things that have been announced @MySQLConnect, I’ve got to play around with them. First stop: space (no.. not ‘the final frontier’).

I need more space on my f/s to get installing. I was a bit of a scrooge when I created my Oracle Linux virtual machine, so now I’m paying the price.

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_ol63uek01-LogVol01
                      7.1G  5.7G  1.1G  85% /

As I’m using Virtual Box, I’ve added a new SATA Controller vmdk of 10G, SATA Port 1 and then start it up.

fdisk -l

Will be able to identify the new & unused partition:

[root@ol63uek01 ~]# fdisk -l
Disk /dev/sda: 8589 MB, 8589934592 bytes
 255 heads, 63 sectors/track, 1044 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: 0x00091104
    Device Boot      Start         End      Blocks   Id  System
 /dev/sda1   *           1          39      307200   83  Linux
 Partition 1 does not end on cylinder boundary.
 /dev/sda2              39        1045     8080384   8e  Linux LVM

 Disk /dev/sdb: 10.7 GB, 10737418240 bytes
 255 heads, 63 sectors/track, 1305 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: 0x00000000

Then:

fdisk /dev/sdb
Command (m for help): c
 DOS Compatibility flag is not set
Command (m for help): u
 Changing display/entry units to sectors

n (add a new partition)

p (primary partition, that is)

1 (it’s the 1st one)

Default First & Last sectors. Means hitting Enter twice.

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM) 

Command (m for help): p
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
107 heads, 17 sectors/track, 11529 cylinders
Units = cylinders of 1819 * 512 = 931328 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1a2cee95

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       11529    10485617   8e  Linux LVM
 
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Now let’s see if it exists, i.e. if it’s a valid disk:

fdisk -l |grep 8e
 /dev/sda2              39        1045     8080384   8e  Linux LVM
 /dev/sdb1               1       11529    10485617   8e  Linux LVM

Setting the physical volume, so we can add it to the volgroup later.

pvcreate -v /dev/sdb1
    Set up physical volume for "/dev/sdb1" with 20971234 available sectors
    Zeroing start of device /dev/sdb1
  Writing physical volume data to disk "/dev/sdb1"
  Physical volume "/dev/sdb1" successfully created
And? Show me what I’ve done then.
pvdisplay /dev/sdb1
  "/dev/sdb1" is a new physical volume of "10.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb1
  VG Name
  PV Size               10.00 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               vw4d8q-6gGV-Sw3E-G4t1-oNJC-cE1d-w1tmwo

Looking at the physical volumes:

pvs
  PV         VG           Fmt  Attr PSize  PFree
  /dev/sda2  vg_ol63uek01 lvm2 a--   7.70g     0
  /dev/sdb1               lvm2 a--  10.00g 10.00g

And we can also see that it’s not assigned to any volgroup yet:

pvscan
  PV /dev/sda2   VG vg_ol63uek01    lvm2 [7.70 GiB / 0    free]
  PV /dev/sdb1                      lvm2 [10.00 GiB]
  Total: 2 [17.70 GiB] / in use: 1 [7.70 GiB] / in no VG: 1 [10.00 GiB]

Nor is it in any logical volume sets:

lvs
  LV       VG           Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  LogVol00 vg_ol63uek01 -wi-ao-- 512.00m                                       
  LogVol01 vg_ol63uek01 -wi-ao--   7.20g 

So, as vg_ol63uek01 is the volgroup name, LogVol01 is the logical volume that we’ll extend, root f/s, we can now do:

lvextend -L +10000M -r vg_ol63uek01/LogVol01  Extending logical volume LogVol01 to 16.97 GiB
  Logical volume LogVol01 successfully resized
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vg_ol63uek01-LogVol01 is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 2
Performing an on-line resize of /dev/mapper/vg_ol63uek01-LogVol01 to 4448256 (4k) blocks.
The filesystem on /dev/mapper/vg_ol63uek01-LogVol01 is now 4448256 blocks long.

That didn’t hurt. Let’s have a look:

lvs
  LV       VG           Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  LogVol00 vg_ol63uek01 -wi-ao-- 512.00m                                        
  LogVol01 vg_ol63uek01 -wi-ao--  16.97g 
 
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_ol63uek01-LogVol01
                       17G  5.7G   11G  36% /

Right.. now the real dilemma.. what to install first.

- MySQL Enterprise Monitor 3.0 (register for the webinar next week)

- MySQL Fabric (http://labs.mysql.com)

- MySQL 5.7.2 / 5.6.14

Decisions decisions..

About these ads

Tags: , , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: