Resize qcow2 root parition
I'm trying to re-size the file system on a Centos 7 vm because I made the vm too small to even do a yum update. I already have done some configurations to the virtual machine and it would be pain to do it all over again, so I've been trying to re-size the virtual machine using virt-resize
On the host machine when I run qemu-img info tkk.qcow2
I get the following information
image: tkk.qcow2
file format: qcow2
virtual size: 17G (18253611008 bytes)
disk size: 2.5G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
The virtual size used to be smaller but I used qemu-img resize tkk.qcow2 +10G
Then I created a backup of the original file tkk.qcow2 with cp tkk.qcow2 tkk-orig.qcow2
and then I ran
virt-resize –expand /dev/sda2 tkk-orig.qcow2 tkk.qcow2
to increase it's size. When I rerun qemu-img info tkk.qcow2
it shows that the Virtual Size has increase by whatever value I added on top of the previous value, but the Disk Size doesn't and I still can't do yum update due to too little space I would like to add at least 5GB more to this minimal vm.
The output of
virt-filesystems --long -h --all -a tkk.qcow2
/dev/sda1 filesystem xfs - - 15G -
/dev/centos_tkk/root filesystem xfs - - 1.3G -
/dev/centos_tkk/swap filesystem swap - - 204M -
/dev/centos_tkk/root lv - - - 1.3G /dev/centos_tkk
/dev/centos_tkk/swap lv - - - 204M /dev/centos_tkk
/dev/centos_tkk vg - - - 1.5G /dev/sda2
/dev/sda2 pv - - - 1.5G -
/dev/sda1 partition - - 83 15G /dev/sda
/dev/sda2 partition - - 8e 1.5G /dev/sda
/dev/sda device - - - 17G -
I have been following these steps on this blog https://fatmin.com/2016/12/20/how-to-resize-a-qcow2-image-and-filesystem-with-virt-resize/
centos qemu
bumped to the homepage by Community♦ 25 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm trying to re-size the file system on a Centos 7 vm because I made the vm too small to even do a yum update. I already have done some configurations to the virtual machine and it would be pain to do it all over again, so I've been trying to re-size the virtual machine using virt-resize
On the host machine when I run qemu-img info tkk.qcow2
I get the following information
image: tkk.qcow2
file format: qcow2
virtual size: 17G (18253611008 bytes)
disk size: 2.5G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
The virtual size used to be smaller but I used qemu-img resize tkk.qcow2 +10G
Then I created a backup of the original file tkk.qcow2 with cp tkk.qcow2 tkk-orig.qcow2
and then I ran
virt-resize –expand /dev/sda2 tkk-orig.qcow2 tkk.qcow2
to increase it's size. When I rerun qemu-img info tkk.qcow2
it shows that the Virtual Size has increase by whatever value I added on top of the previous value, but the Disk Size doesn't and I still can't do yum update due to too little space I would like to add at least 5GB more to this minimal vm.
The output of
virt-filesystems --long -h --all -a tkk.qcow2
/dev/sda1 filesystem xfs - - 15G -
/dev/centos_tkk/root filesystem xfs - - 1.3G -
/dev/centos_tkk/swap filesystem swap - - 204M -
/dev/centos_tkk/root lv - - - 1.3G /dev/centos_tkk
/dev/centos_tkk/swap lv - - - 204M /dev/centos_tkk
/dev/centos_tkk vg - - - 1.5G /dev/sda2
/dev/sda2 pv - - - 1.5G -
/dev/sda1 partition - - 83 15G /dev/sda
/dev/sda2 partition - - 8e 1.5G /dev/sda
/dev/sda device - - - 17G -
I have been following these steps on this blog https://fatmin.com/2016/12/20/how-to-resize-a-qcow2-image-and-filesystem-with-virt-resize/
centos qemu
bumped to the homepage by Community♦ 25 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm trying to re-size the file system on a Centos 7 vm because I made the vm too small to even do a yum update. I already have done some configurations to the virtual machine and it would be pain to do it all over again, so I've been trying to re-size the virtual machine using virt-resize
On the host machine when I run qemu-img info tkk.qcow2
I get the following information
image: tkk.qcow2
file format: qcow2
virtual size: 17G (18253611008 bytes)
disk size: 2.5G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
The virtual size used to be smaller but I used qemu-img resize tkk.qcow2 +10G
Then I created a backup of the original file tkk.qcow2 with cp tkk.qcow2 tkk-orig.qcow2
and then I ran
virt-resize –expand /dev/sda2 tkk-orig.qcow2 tkk.qcow2
to increase it's size. When I rerun qemu-img info tkk.qcow2
it shows that the Virtual Size has increase by whatever value I added on top of the previous value, but the Disk Size doesn't and I still can't do yum update due to too little space I would like to add at least 5GB more to this minimal vm.
The output of
virt-filesystems --long -h --all -a tkk.qcow2
/dev/sda1 filesystem xfs - - 15G -
/dev/centos_tkk/root filesystem xfs - - 1.3G -
/dev/centos_tkk/swap filesystem swap - - 204M -
/dev/centos_tkk/root lv - - - 1.3G /dev/centos_tkk
/dev/centos_tkk/swap lv - - - 204M /dev/centos_tkk
/dev/centos_tkk vg - - - 1.5G /dev/sda2
/dev/sda2 pv - - - 1.5G -
/dev/sda1 partition - - 83 15G /dev/sda
/dev/sda2 partition - - 8e 1.5G /dev/sda
/dev/sda device - - - 17G -
I have been following these steps on this blog https://fatmin.com/2016/12/20/how-to-resize-a-qcow2-image-and-filesystem-with-virt-resize/
centos qemu
I'm trying to re-size the file system on a Centos 7 vm because I made the vm too small to even do a yum update. I already have done some configurations to the virtual machine and it would be pain to do it all over again, so I've been trying to re-size the virtual machine using virt-resize
On the host machine when I run qemu-img info tkk.qcow2
I get the following information
image: tkk.qcow2
file format: qcow2
virtual size: 17G (18253611008 bytes)
disk size: 2.5G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
The virtual size used to be smaller but I used qemu-img resize tkk.qcow2 +10G
Then I created a backup of the original file tkk.qcow2 with cp tkk.qcow2 tkk-orig.qcow2
and then I ran
virt-resize –expand /dev/sda2 tkk-orig.qcow2 tkk.qcow2
to increase it's size. When I rerun qemu-img info tkk.qcow2
it shows that the Virtual Size has increase by whatever value I added on top of the previous value, but the Disk Size doesn't and I still can't do yum update due to too little space I would like to add at least 5GB more to this minimal vm.
The output of
virt-filesystems --long -h --all -a tkk.qcow2
/dev/sda1 filesystem xfs - - 15G -
/dev/centos_tkk/root filesystem xfs - - 1.3G -
/dev/centos_tkk/swap filesystem swap - - 204M -
/dev/centos_tkk/root lv - - - 1.3G /dev/centos_tkk
/dev/centos_tkk/swap lv - - - 204M /dev/centos_tkk
/dev/centos_tkk vg - - - 1.5G /dev/sda2
/dev/sda2 pv - - - 1.5G -
/dev/sda1 partition - - 83 15G /dev/sda
/dev/sda2 partition - - 8e 1.5G /dev/sda
/dev/sda device - - - 17G -
I have been following these steps on this blog https://fatmin.com/2016/12/20/how-to-resize-a-qcow2-image-and-filesystem-with-virt-resize/
centos qemu
centos qemu
asked Mar 6 '17 at 19:54
KatzKatz
2932627
2932627
bumped to the homepage by Community♦ 25 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 25 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Since you're using LVM it's necessary to expand the PV (Physical Volume) firstly and then expand the LVM root partition.
You can follow this how-to:
https://dnaeon.github.io/resizing-a-kvm-disk-image-on-lvm-the-hard-way/
add a comment |
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%2f349586%2fresize-qcow2-root-parition%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
Since you're using LVM it's necessary to expand the PV (Physical Volume) firstly and then expand the LVM root partition.
You can follow this how-to:
https://dnaeon.github.io/resizing-a-kvm-disk-image-on-lvm-the-hard-way/
add a comment |
Since you're using LVM it's necessary to expand the PV (Physical Volume) firstly and then expand the LVM root partition.
You can follow this how-to:
https://dnaeon.github.io/resizing-a-kvm-disk-image-on-lvm-the-hard-way/
add a comment |
Since you're using LVM it's necessary to expand the PV (Physical Volume) firstly and then expand the LVM root partition.
You can follow this how-to:
https://dnaeon.github.io/resizing-a-kvm-disk-image-on-lvm-the-hard-way/
Since you're using LVM it's necessary to expand the PV (Physical Volume) firstly and then expand the LVM root partition.
You can follow this how-to:
https://dnaeon.github.io/resizing-a-kvm-disk-image-on-lvm-the-hard-way/
answered Mar 6 '17 at 22:28
DarkVexDarkVex
1336
1336
add a comment |
add a comment |
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%2f349586%2fresize-qcow2-root-parition%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