I'm trying to make a fresh install of Archlinux on my laptop but I'm stuck with the bootloader installation.
I chose to give LVM a try and thus need to use GRUB2 because I got used to it over the time and don't want to manage a separate /boot partition.
Everything went ok until I tried to copy the core.img file to the post-MBR gap by issuing grub-install
grub-install --target=i386-pc --recheck /dev/sda /usr/sbin/grub-bios-setup: warning: your core.img is unusually large. It won't fit in the embedding area. /usr/sbin/grub-bios-setup: error: embedding is not possible, but this is required for RAID and LVM install.
So it seems that because of my LVM partitions, GRUB2 needs a bigger core.img ! I didn't know it before starting and I let cfdisk use XP-compliant parition alignment (or whatever it is). Then I created a VG with /dev/sda1 as the only PV in it :
fdisk -l /dev/sda Disk /dev/sda: 160.0 GB, 160041885696 bytes, 312581808 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0c1a07c1 Device Boot Start End Blocks Id System /dev/sda1 * 63 234372284 117186111 8e Linux LVM /dev/sda2 234372285 312581807 39104761+ 8e Linux LVM
I took a quick look at the parted documentation but LVM partition resizing is not mentionned :
Supported file systems: ext2, ext3 - restriction: the new start must be the same as the old start. fat16, fat32 linux-swap reiserfs (if libreiserfs is installed)
But it seems possible to resize virtual partitions using parted (https://www.gnu.org/software/parted/man … html#SEC66) and, by chance, the first virtual partition on my physical partition is my swap partition (which can be resized by parted):
lvdisplay -m --- Logical volume --- LV Path /dev/vg1/archSwap LV Name archSwap VG Name vg1 LV UUID FCvmH1-7spl-A6N1-AVw9-GPmI-opqX-AP5yVC LV Write Access read/write LV Creation host, time , LV Status available # open 2 LV Size 3.00 GiB Current LE 768 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 254:3 --- Segments --- Logical extent 0 to 767: Type linear Physical volume /dev/sda1 Physical extents 0 to 767
So is there any hope I can resize my virtual swap partition using parted then the LVM partition itself (or any other tool capable of it?) or am I screwed up here?
Thanks for your help!
Last edited by sclarckone (2012-10-23 11:30:59)
But those seem to focus on prevention rather than cure...
Missed that one! I guess I used cfdisk to partition my disk and it seems that it automatically starts first partition at sector 63 for MBR partitioning scheme... it might worth adding a warning about that in the beginners guide ?
It does seem possible to shrink a PV (http://fedorasolved.org/Members/zcat/sh … -partition) but even in the man pages I don't see any way of specifying where the partitions must start. Besides, I guess that shrinking volumes is done by moving the end so it probably won't work for me.
Since I don't have much to lose and a lot of free space on my PV I'll just try to remove and recreate the physical partition /dev/sda1 and then try to rebuild the lvm using pvchange, vgchange and lvchange.
I couldn't manage to resize the PV...
What I did was removing the physical partition /dev/sda1 then recreate it again starting from sector 2048 instead of 63. But when I tried to rebuild the PV using pvchange it wasn't possible.
It might have been my fault since I didn't check before that the kernel has mapped my previous LV (since I was running from the live environment) and it could be why pvchange was just returning me some error messages (there was something about a cache but I didn't have enough time to look deeper into this).
Anyway, I removed all my partitions, recreated my PV,VG,LV and re-installed Arch. Now it works perfectly.
sclarckone, please do not mark a solved thread CLOSED. This is reserved for threads the moderators put in a read-only state. Use SOLVED instead. See the forum etiquette about this.
(I changed the thread title for you to avoid confusion.)
To know or not to know ...
... the questions remain forever.