Re: Debian in a VMware VM and LVM



On Tuesday 13 March 2012 22:52:01 Bonno Bloksma wrote:

Using the 6.0.4 amd netinst CD I created a small 10GB virtual machine (VM).
I then realized I needed it to be a bit bigger so I wanted to extend the
LVM environment and add that space to the /var logical volume. Of course
as this is a new VM I just could have started from scratch but I am trying
to learn something as well. ;-)

First I had a look at the current disk layout using fdisk -l

root@wwwgw:~# fdisk -l

Disk /dev/sda: 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: 0x000d6e97

Device Boot Start End Blocks Id System
/dev/sda1 1 37 291840 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 37 1306 10190849 5 Extended
/dev/sda5 37 1306 10190848 8e Linux LVM

1)
Why the warning about the 300MB /boot partition not ending on a cylinder
boundary? I used the manual setup in the Debian 6.0.4 installation and
told it to create a 300MB partition at the beginning of the disk. Did the
installation software do something wrong or should I have know something I
do not know yet?
Older versions of fdisk by default aligns to cylinder. This is deprecated and
not the case now. Simply suppress this warning by using -cu

2)
After that came a lot of warnings about /dev/dm-0, /dev/dm-1, /dev/dm-2,
/dev/dm-3 and /dev/dm-4. I know those are LVM2 devices but... Why is fdisk
(still) seeing them as disks/partitions it has to show during a listing,
and then complain they are not valid?

I think this is a bug in fdisk.

At the VMware level I increased the disk from 10GB to 12GB. Using cfdisk,
which in my opinion gives less cause for a user error, I created a new
logical sda6 partition in the free space. The end result is: root@wwwgw:~#
fdisk -l

Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 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: 0x000d6e97

Device Boot Start End Blocks Id System
/dev/sda1 1 37 291840 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 37 1566 12285008 5 Extended
/dev/sda5 37 1306 10190848 8e Linux LVM
/dev/sda6 1306 1566 2094127+ 8e Linux

3)
Why is there a + at the end of the number of blocks?
In fdisk, a block is 1024 bytes. The partition does not contain integral
number of blocks, hence the + sign.

I then want to make the sda6 partition a LVM physical volume using
root@wwwgw:~# pvcreate /dev/sda6
Device /dev/sda6 not found (or ignored by filtering).
root@wwwgw:~#
indeed, there is no /dev/sda6 yet.

4)
Why is /dev/sda6 not there yet? What step am I missing?
You should run partprobe(8) or reboot your machine.


Ok, after a reboot (it is not a production server yet) the /dev/sda6 is
there. Form here on it was (almost) straight sailing. ;-)

root@wwwgw:~# pvcreate /dev/sda6
Physical volume "/dev/sda6" successfully created
root@wwwgw:~# vgextend vgroup1 /dev/sda6
Volume group "vgroup1" successfully extended

Then to runlevel 1 to make sure (almost) nothing is using the /var
directory tree and
root@wwwgw:~# lvextend -l+2G /dev/vgroup1/lvvar
Extending logical volume lvvar to 3.86GiB
Logical volume lvvar successfully resized

root@wwwgw:~# umount /var
Then first a filesystem check as that seems to be needed before resizing.
Not doing so will give me a warning although this was not mentioned in the
HOWTOs I have read. root@wwwgw:~# fsck -f /dev/vgroup1/lvvar
root@wwwgw:~# resize2fs /dev/vgroup1/lvvar
root@wwwgw:~# mount /var

and back to runlevel 2


Anything else I missed?

Bonno Bloksma


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/201203161916.32502.miklcct@xxxxxxxxx



Relevant Pages

  • Re: Error 16: Inconsistent filesystem structure
    ... My preference would be a /home partition to protect my data ... Here is a copy of the output of fdisk -l and fdisk /dev/sdb with x then ... I used the Negus Fedora 7 book's Live cd. ... Disk /dev/sdb: 200.0 GB, 200049647616 bytes ...
    (Fedora)
  • Re: grub error 18
    ... because I thought the EXTEND partition would be the second partition in ... Selected cylinder exceeds maximum supported by BIOS." ... the disk using CHS addressing (that is: telling the BIOS a head number, ... sectors per track gave 32k bytes per track, ...
    (uk.comp.homebuilt)
  • Re: Resizing NTFS partition to make room for FC10
    ... I have a 150GB ATA disk, /dev/hdb, containing winxp. ... I started by using ntfsresize to shrink the xp partition ... still, according to fdisk, thinks its 150GB. ... quickly blue screening a message I couldn't read, and rebooting. ...
    (Fedora)
  • Re: Is it fdisk thats dangerous?
    ... have never EVER had any problems with fdisk at all. ... PowerQuest EasyRestore has detected an error 116 on the partition ... The LBA and CHS values must be ... This will destroy all data on the hard disk ...
    (alt.os.linux)
  • tool to resize partitions on cylinder boundaries?
    ... I have a couple of 40 GB drives in a machine whose BIOS only supports hard disk drives up to 32 GiB. ... The motherboard (BIOStar M6TLC) manufacturer has confirmed that it is not possible to work around this limitation via a BIOS upgrade. ... However, cfdisk, fdisk and Partition Magic report problems with the first disk: ... Partition 2 does not end on cylinder boundary. ...
    (Debian-User)