[CentOS] mkswap, lvm and bootbits sectors

Wed Mar 14 10:50:37 UTC 2012
Philippe Naudin <philippe.naudin at supagro.inra.fr>

Le mer. 14 mars 2012 09:08:46 CET, Peter Kjellström a écrit:

> On Tuesday 13 March 2012 13.20.01 m.roth at 5-cent.us wrote:
> > Peter Kjellström wrote:
> > > On Tuesday 13 March 2012 13.41.53 Philippe Naudin wrote:
> > >> Hello,
> > >> 
> > >> I am confused by a warning from mkswap :
> > >> 
> > >> When making a swap on a LVM volume, I see the following warning :
> > >>   mkswap: /dev/vg_SDB1/swap_test6_64: warning: don't erase bootbits
> ...
> > <snip>
> > Are you making swap from a logical partition, or a swapfile? If the
> > former, perhaps recreating the partition might help.
> 
> Don't confuse the poor guy. 1) yes he's doing mkswap on an lv which was 
> obvious had you read the post 2) an lv does not have a partition table so your 
> statement about recreating it makes no sense.

Thanks all for your answers.

Actually, my problem concern lvm, not mkswap. I don't know yet if I
have completely messed with vgcreate/lvcreate or if what I get is due
to some difference between CentOS-5 and CentOS-6, but all my logical
volumes seem to appear as distinct disks.

On a CentOS-6 machine :

$ lvcreate -L 10M --name try_lvcreate --zero=y VolGroup
  Rounding up size to full physical extent 12.00 MiB
  Logical volume "try_lvcreate" created

$ fdisk -l
  <snip the "normal" partitions table for /dev/sda>

Disk /dev/mapper/VolGroup-try_lvcreate: 12 MB, 12582912 bytes
255 heads, 63 sectors/track, 1 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/VolGroup-try_lvcreate doesn't contain a valid partition table

$ mkswap /dev/mapper/VolGroup-try_lvcreate
mkswap: /dev/mapper/VolGroup-try_lvcreate: warning: don't erase bootbits sectors
        on whole disk. Use -f to force.
Setting up swapspace version 1, size = 12284 KiB
no label, UUID=be229ca5-bcb9-4116-87fc-8878abb44742

The same commands on a CentOS-5 machine give me a completely 
different output. Can you guess where I have messed, or is this 
behavior correct on CentOS-6 ?

Thanks,

-- 
Philippe Naudin