Why can't I create a physical volume?
I was wondering why I can't create a physical volume? Every settings are default for lvm just installed (
For cat /etc/lvm/lvm.conf see https://paste.ubuntu.com/p/QqrszWR8M9/).
Is it because of "Failed to start lvm2.service: Unit lvm2.service is masked"? Thanks.
$ sudo parted -l
Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 EFI System Partition boot, esp
2 538MB 500GB 500GB ext4
$ sudo lvmdiskscan
/dev/sda1 [ 512.00 MiB]
/dev/sda2 [ <465.26 GiB]
0 disks
2 partitions
0 LVM physical volume whole disks
0 LVM physical volumes
$ sudo pvcreate /dev/sda
Device /dev/sda excluded by a filter.
$ sudo lvmdiskscan
/dev/sda1 [ 512.00 MiB]
/dev/sda2 [ <465.26 GiB]
0 disks
2 partitions
0 LVM physical volume whole disks
0 LVM physical volumes
$ sudo pvcreate /dev/sda2
Can't open /dev/sda2 exclusively. Mounted filesystem?
ubuntu lvm
add a comment |
I was wondering why I can't create a physical volume? Every settings are default for lvm just installed (
For cat /etc/lvm/lvm.conf see https://paste.ubuntu.com/p/QqrszWR8M9/).
Is it because of "Failed to start lvm2.service: Unit lvm2.service is masked"? Thanks.
$ sudo parted -l
Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 EFI System Partition boot, esp
2 538MB 500GB 500GB ext4
$ sudo lvmdiskscan
/dev/sda1 [ 512.00 MiB]
/dev/sda2 [ <465.26 GiB]
0 disks
2 partitions
0 LVM physical volume whole disks
0 LVM physical volumes
$ sudo pvcreate /dev/sda
Device /dev/sda excluded by a filter.
$ sudo lvmdiskscan
/dev/sda1 [ 512.00 MiB]
/dev/sda2 [ <465.26 GiB]
0 disks
2 partitions
0 LVM physical volume whole disks
0 LVM physical volumes
$ sudo pvcreate /dev/sda2
Can't open /dev/sda2 exclusively. Mounted filesystem?
ubuntu lvm
I do not. Why default configurations do that?
– Tim
1 hour ago
It is in lvm.conf
– Rui F Ribeiro
1 hour ago
add a comment |
I was wondering why I can't create a physical volume? Every settings are default for lvm just installed (
For cat /etc/lvm/lvm.conf see https://paste.ubuntu.com/p/QqrszWR8M9/).
Is it because of "Failed to start lvm2.service: Unit lvm2.service is masked"? Thanks.
$ sudo parted -l
Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 EFI System Partition boot, esp
2 538MB 500GB 500GB ext4
$ sudo lvmdiskscan
/dev/sda1 [ 512.00 MiB]
/dev/sda2 [ <465.26 GiB]
0 disks
2 partitions
0 LVM physical volume whole disks
0 LVM physical volumes
$ sudo pvcreate /dev/sda
Device /dev/sda excluded by a filter.
$ sudo lvmdiskscan
/dev/sda1 [ 512.00 MiB]
/dev/sda2 [ <465.26 GiB]
0 disks
2 partitions
0 LVM physical volume whole disks
0 LVM physical volumes
$ sudo pvcreate /dev/sda2
Can't open /dev/sda2 exclusively. Mounted filesystem?
ubuntu lvm
I was wondering why I can't create a physical volume? Every settings are default for lvm just installed (
For cat /etc/lvm/lvm.conf see https://paste.ubuntu.com/p/QqrszWR8M9/).
Is it because of "Failed to start lvm2.service: Unit lvm2.service is masked"? Thanks.
$ sudo parted -l
Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 EFI System Partition boot, esp
2 538MB 500GB 500GB ext4
$ sudo lvmdiskscan
/dev/sda1 [ 512.00 MiB]
/dev/sda2 [ <465.26 GiB]
0 disks
2 partitions
0 LVM physical volume whole disks
0 LVM physical volumes
$ sudo pvcreate /dev/sda
Device /dev/sda excluded by a filter.
$ sudo lvmdiskscan
/dev/sda1 [ 512.00 MiB]
/dev/sda2 [ <465.26 GiB]
0 disks
2 partitions
0 LVM physical volume whole disks
0 LVM physical volumes
$ sudo pvcreate /dev/sda2
Can't open /dev/sda2 exclusively. Mounted filesystem?
ubuntu lvm
ubuntu lvm
edited 1 hour ago
Tim
asked 1 hour ago
TimTim
27.2k78262472
27.2k78262472
I do not. Why default configurations do that?
– Tim
1 hour ago
It is in lvm.conf
– Rui F Ribeiro
1 hour ago
add a comment |
I do not. Why default configurations do that?
– Tim
1 hour ago
It is in lvm.conf
– Rui F Ribeiro
1 hour ago
I do not. Why default configurations do that?
– Tim
1 hour ago
I do not. Why default configurations do that?
– Tim
1 hour ago
It is in lvm.conf
– Rui F Ribeiro
1 hour ago
It is in lvm.conf
– Rui F Ribeiro
1 hour ago
add a comment |
1 Answer
1
active
oldest
votes
You're trying to use the entire /dev/sda for a PV. But you've got (at least) two partitions on that disk (sda1 and sda2), so LVM is rightly refusing to honour your request.
Thanks.sudo pvcreate /dev/sda2doesn't work either
– Tim
1 hour ago
It's got a filesystem on it. LVM is doing its best to stop you breaking your system.
– roaima
1 hour ago
Must a physical volume be created from a partition without filesystem?
– Tim
1 hour ago
Yes. Absolutely.
– roaima
1 hour ago
Where is that mentioned in documentation?
– Tim
1 hour ago
|
show 4 more comments
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502424%2fwhy-cant-i-create-a-physical-volume%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You're trying to use the entire /dev/sda for a PV. But you've got (at least) two partitions on that disk (sda1 and sda2), so LVM is rightly refusing to honour your request.
Thanks.sudo pvcreate /dev/sda2doesn't work either
– Tim
1 hour ago
It's got a filesystem on it. LVM is doing its best to stop you breaking your system.
– roaima
1 hour ago
Must a physical volume be created from a partition without filesystem?
– Tim
1 hour ago
Yes. Absolutely.
– roaima
1 hour ago
Where is that mentioned in documentation?
– Tim
1 hour ago
|
show 4 more comments
You're trying to use the entire /dev/sda for a PV. But you've got (at least) two partitions on that disk (sda1 and sda2), so LVM is rightly refusing to honour your request.
Thanks.sudo pvcreate /dev/sda2doesn't work either
– Tim
1 hour ago
It's got a filesystem on it. LVM is doing its best to stop you breaking your system.
– roaima
1 hour ago
Must a physical volume be created from a partition without filesystem?
– Tim
1 hour ago
Yes. Absolutely.
– roaima
1 hour ago
Where is that mentioned in documentation?
– Tim
1 hour ago
|
show 4 more comments
You're trying to use the entire /dev/sda for a PV. But you've got (at least) two partitions on that disk (sda1 and sda2), so LVM is rightly refusing to honour your request.
You're trying to use the entire /dev/sda for a PV. But you've got (at least) two partitions on that disk (sda1 and sda2), so LVM is rightly refusing to honour your request.
answered 1 hour ago
roaimaroaima
44.9k756122
44.9k756122
Thanks.sudo pvcreate /dev/sda2doesn't work either
– Tim
1 hour ago
It's got a filesystem on it. LVM is doing its best to stop you breaking your system.
– roaima
1 hour ago
Must a physical volume be created from a partition without filesystem?
– Tim
1 hour ago
Yes. Absolutely.
– roaima
1 hour ago
Where is that mentioned in documentation?
– Tim
1 hour ago
|
show 4 more comments
Thanks.sudo pvcreate /dev/sda2doesn't work either
– Tim
1 hour ago
It's got a filesystem on it. LVM is doing its best to stop you breaking your system.
– roaima
1 hour ago
Must a physical volume be created from a partition without filesystem?
– Tim
1 hour ago
Yes. Absolutely.
– roaima
1 hour ago
Where is that mentioned in documentation?
– Tim
1 hour ago
Thanks.
sudo pvcreate /dev/sda2 doesn't work either– Tim
1 hour ago
Thanks.
sudo pvcreate /dev/sda2 doesn't work either– Tim
1 hour ago
It's got a filesystem on it. LVM is doing its best to stop you breaking your system.
– roaima
1 hour ago
It's got a filesystem on it. LVM is doing its best to stop you breaking your system.
– roaima
1 hour ago
Must a physical volume be created from a partition without filesystem?
– Tim
1 hour ago
Must a physical volume be created from a partition without filesystem?
– Tim
1 hour ago
Yes. Absolutely.
– roaima
1 hour ago
Yes. Absolutely.
– roaima
1 hour ago
Where is that mentioned in documentation?
– Tim
1 hour ago
Where is that mentioned in documentation?
– Tim
1 hour ago
|
show 4 more comments
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f502424%2fwhy-cant-i-create-a-physical-volume%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I do not. Why default configurations do that?
– Tim
1 hour ago
It is in lvm.conf
– Rui F Ribeiro
1 hour ago