Friday 22 June 2018

partitioning - Fedora 18 add new hard disk with LVM Partition


I recently built my 1st computer and realized today that despite having multiple hard disks, I'm out of space because I did not set up the partitions correctly.


I am trying to add two of my hard disks (not the boot disk) to my LVM group.


First I made LVM partitions in my two drives following the example here: http://www.server-world.info/en/note?os=Fedora_18&p=add_hd


Now, the output of fdisk -l shows me:


[root@localhost lvm]# fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x1d04f8ff

Device Boot Start End Blocks Id System
/dev/sda1 2048 3907029167 1953513560 8e Linux LVM

Disk /dev/sdb: 256.1 GB, 256060514304 bytes, 500118192 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: 0x000988f9

Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 1026047 512000 83 Linux
/dev/sdb2 1026048 500117503 249545728 8e Linux LVM

Disk /dev/sdc: 500.1 GB, 500107862016 bytes, 976773168 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: 0x00000081

Device Boot Start End Blocks Id System
/dev/sdc1 * 63 976768064 488384001 83 Linux

Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0xa2da0487

Device Boot Start End Blocks Id System
/dev/sdd1 2048 3907029167 1953513560 8e Linux LVM

Disk /dev/mapper/fedora-swap: 8338 MB, 8338276352 bytes, 16285696 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 /dev/mapper/fedora-root: 53.7 GB, 53687091200 bytes, 104857600 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 /dev/mapper/fedora-home: 193.5 GB, 193508409344 bytes, 377946112 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

Now, to add the new created partitions to the LVM group, I was following the instructions provided here: http://www.techotopia.com/index.php/Adding_a_New_Disk_to_a_Fedora_Volume_Group_and_Logical_Volume I should run pvcreate sda which gives me:


[root@localhost namu]# pvcreate /dev/sda
Device /dev/sda not found (or ignored by filtering).

In \etc\lvm\lvm.conf, I have the filter set to


filter = [ "a/.*/" ]

I deleted /etc/lvm/cache and rebooted my system but pvcreate sda still returns the same message.


I ran the set of commands below to see if my computer is properly detecting these partitions:


[root@localhost namu]# cat /proc/mdstat
Personalities :
unused devices:
[root@localhost namu]# pvscan
PV /dev/sdb2 VG fedora lvm2 [237.98 GiB / 0 free]
Total: 1 [237.98 GiB] / in use: 1 [237.98 GiB] / in no VG: 0 [0 ]
[root@localhost namu]# lvscan
ACTIVE '/dev/fedora/swap' [7.77 GiB] inherit
ACTIVE '/dev/fedora/home' [180.22 GiB] inherit
ACTIVE '/dev/fedora/root' [50.00 GiB] inherit

and it does not seem to be. Can someone please help? Thank you.



Answer



I figured it out at last.


The problem is that by changing the format of my drive to LVM, I am actually creating a partition of my hard disk (which is almost the entire hard disk). The partition is /dev/sda1. Therefore, I have to use the command


pvcreate /dev/sda1


In case anyone in the future has trouble with adding a hard disk into an existing LVM group, I recommend following instructions on


http://www.server-world.info/en/note?os=Fedora_18&p=add_hd


to create an LVM partition and then


http://www.techotopia.com/index.php/Adding_a_New_Disk_to_a_Fedora_Volume_Group_and_Logical_Volume


to add this new partition to the volume group.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...