2

I have a VirtualBox Linux Guest (Oracle Enterprise Linux 6) and I recently expanded hard drive from 50Gb to 100Gb and then used GParted to resize to use the newly added 50GB (as this was unallocated). All this was successful but then I came across the error "No free sectors available"

[root@oralab1 Desktop]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_oralab1-lv_root
                       45G  4.2G   39G  10% /
tmpfs                 7.9G  100K  7.9G   1% /dev/shm
/dev/sda1             485M   55M  405M  12% /boot
[root@oralab1 Desktop]# 
[root@oralab1 Desktop]# fdisk -l

Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0x000ef7c4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       13055   104344576   8e  Linux LVM

Disk /dev/mapper/vg_oralab1-lv_root: 49.0 GB, 48997859328 bytes
255 heads, 63 sectors/track, 5956 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


Disk /dev/mapper/vg_oralab1-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 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

[root@oralab1 Desktop]# 
[root@oralab1 Desktop]# 
[root@oralab1 Desktop]# 
[root@oralab1 Desktop]# 
[root@oralab1 Desktop]# fdisk /dev/sda

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/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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: 0x000ef7c4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       13055   104344576   8e  Linux LVM

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
No free sectors available

Command (m for help): ^C

I need to expand and use the full 100GB.

Attachment (pvs, vgs and lvs output)

  • You have already a 100gb size sda2. (104344576 8e Linux LVM) – Ipor Sircer Dec 15 '16 at 1:04
  • Please edit your question to add the output of pvs, vgs and lvs. – Stephen Kitt Dec 15 '16 at 6:07
  • Stephen, I have provided the pvs vgs and lvs output – AJsStack Dec 15 '16 at 9:20
0

If you want to create new partition you may use lvcreate instead of fdisk /dev/sda. Follow the bellow step in command line

Step 1:

 #  lvcreate --name lvname --size lvsize vgname
 # ex lvcreate --name lv_home --size 30G vg_oralab1

Step 2: Format the Logical volume(lv) by any linux filesystem

 # mkfs.xfs /dev/vg_oralab1/lv_home

Step 3: Create mount point and mount the lv

# mkdir /lv_part
# mount /dev/vg_oralab1/lv_home  /lv_part

Step 4: Check the partition by

# df -h

NOTE: For permanent mount give entry in /etc/fstab

0

you already have all the disk at sda2, as I can see at pvs command (size 99Gb, 50GB free)

So you only have to increased the lvs partition that already have.

lvextend -l +100%FREE /dev/mapper/vg_oralab1-lv_root

and resize at os level:

resize2fs /dev/mapper/vg_oralab1-lv_root

now you are using all the size in your lvm filesystem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.