LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-30-2017, 08:59 AM   #1
Tinatach
LQ Newbie
 
Registered: Jun 2017
Posts: 2

Rep: Reputation: Disabled
Creating partitions & Logical volume


sdb1p1 shows that it has been created as LVM. However, when I try to create a physical volume with pvcreate /dev/sdb1 command so that I can be able to create logical volumes: the output is: Can't open /dev/sdb1 exclusively. Mounted filesystem?

Please help, I am still a newbie!.

This is the output on my screen


Device Boot Start End Blocks Id System
/dev/sdb1p1 63 16064 8001 8e Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@Angels ~]# vgcreate /dev/sdb1
Please enter a physical volume path
Run `vgcreate --help' for more information.
[root@Angels ~]# pvcreate /dev/sdb1
Can't open /dev/sdb1 exclusively. Mounted filesystem?

Last edited by Tinatach; 06-30-2017 at 09:03 AM.
 
Old 06-30-2017, 09:10 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,555

Rep: Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088
Quote:
Originally Posted by Tinatach View Post
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Which of those recommendations did you follow? There is apparently something in use on /dev/sdb the caused the automatic loading of the new partition table to fail. The output from "lsblk -f /dev/sdb" (run as root) might be helpful. Wrap it in [CODE] ... [/CODE] tags, please, to preserve formatting.
 
Old 06-30-2017, 09:21 AM   #3
Tinatach
LQ Newbie
 
Registered: Jun 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post
Which of those recommendations did you follow? There is apparently something in use on /dev/sdb the caused the automatic loading of the new partition table to fail. The output from "lsblk -f /dev/sdb" (run as root) might be helpful. Wrap it in [CODE] ... [/CODE] tags, please, to preserve formatting.
I rebooted the system with partprobe and init 6 but it did not help. I will try your suggestion. thanks.

I ran the command above "lsblk -f /dev/sdb" and it is not showing up LVM has been created.

This is the screen:

sdb
├─sdb1 ext4 4ba75c2b-55d4-44c3-a25b-a3aa8a0e92ed /newday
├─sdb2 LVM2_member BWqQLM-UiKd-0OMj-FLpZ-6pJ9-jUAG-A0PfAv
│ └─vg01-lv01 (dm-1)
ext4 551e026d-89a9-43c1-b735-5602998eaa8b /timeless
├─sdb3 LVM2_member fHYRKf-u40n-3LQ7-7uD5-aENa-M1Jk-nHQmxV
│ └─vg02-lv02 (dm-0)
ext4 3b2594e3-74fb-4979-a352-9e309a612f3c /today
└─sdb4 ext4 0db5f476-5299-4040-9e32-ae2d7b391211 /testfile

Last edited by Tinatach; 06-30-2017 at 09:24 AM.
 
Old 06-30-2017, 12:24 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,555

Rep: Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088Reputation: 2088
Well, that's pretty obvious. Partition sdb1 has an ext4 filesystem that is currently mounted on /newday. You can't convert it to an LVM physical volume without unmounting it, and that conversion would destroy the current content.

That's presumably not what you intended, so just what are you trying to do? Taking an existing, formatted partition and making it part of an LVM volume group is not a simple process.
 
Old 06-30-2017, 06:40 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,627

Rep: Reputation: 4187Reputation: 4187Reputation: 4187Reputation: 4187Reputation: 4187Reputation: 4187Reputation: 4187Reputation: 4187Reputation: 4187Reputation: 4187Reputation: 4187
Quote:
Device Boot Start End Blocks Id System
/dev/sdb1p1 63 16064 8001 8e Linux LVM
In addition, a device ID of /dev/sdb1p1 usually means you created a partition within a partition. Most likely caused by using the command fdisk /dev/sdb1 instead of fdisk /dev/sdb. This is why lsblk did not show /dev/sdb1 as LVM.
 
Old 07-01-2017, 02:02 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
Hi Tinatach,

Welcome to LQ!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing volume group before creating logical volume fanoflq Linux - Newbie 1 07-26-2016 06:32 PM
creating logical volume dthaler Linux - Enterprise 3 12-27-2012 11:58 AM
creating logical volume of exact specified size devkpict Linux - Software 1 07-16-2009 03:59 AM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 06:15 PM
Creating a logical volume on RHEL3 samash Red Hat 3 06-17-2006 11:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration