Shrinking LVM partition in order to enlarge swap on Ubuntu Mate 18.04
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
2
down vote
favorite
I'm facing an issue in my Ubuntu Mate 18.04 system.
I installed the file system in a LVM partition and would like to enlarge the swap space. I followed the instructions here but I get this message when I try to enlarge the partition
Insufficient free space: 512 extents needed, but only 0 available
This is the content of my disk according to fdisk -l
Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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
Disklabel type: gpt
Disk identifier: 8F28ED66-4E76-4B77-AB4B-D0AB345E21CA
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 488396799 487346176 232,4G Linux LVM
Disk /dev/mapper/ubuntu--mate--vg-root: 231,4 GiB, 248474763264 bytes, 485302272 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/ubuntu--mate--vg-swap_1: 996 MiB, 1044381696 bytes, 2039808 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
It seems like there's no free space left on the Physical volume in order to further enlarge the swap partition. If I type
sudo lvresize -l +100%FREE /dev/ubuntu-mate-vg/swap_1
I get
New size (249 extents) matches existing size (249 extents).
Therefore I'd like to shrink a bit (say, 5 Gb) my main partition vg-root and make that space available for swap. But I don't know how to do it :-/ Do you have any suggestion?
Thank you
Marco
partitioning lvm mate ubuntu-mate
add a comment |Â
up vote
2
down vote
favorite
I'm facing an issue in my Ubuntu Mate 18.04 system.
I installed the file system in a LVM partition and would like to enlarge the swap space. I followed the instructions here but I get this message when I try to enlarge the partition
Insufficient free space: 512 extents needed, but only 0 available
This is the content of my disk according to fdisk -l
Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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
Disklabel type: gpt
Disk identifier: 8F28ED66-4E76-4B77-AB4B-D0AB345E21CA
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 488396799 487346176 232,4G Linux LVM
Disk /dev/mapper/ubuntu--mate--vg-root: 231,4 GiB, 248474763264 bytes, 485302272 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/ubuntu--mate--vg-swap_1: 996 MiB, 1044381696 bytes, 2039808 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
It seems like there's no free space left on the Physical volume in order to further enlarge the swap partition. If I type
sudo lvresize -l +100%FREE /dev/ubuntu-mate-vg/swap_1
I get
New size (249 extents) matches existing size (249 extents).
Therefore I'd like to shrink a bit (say, 5 Gb) my main partition vg-root and make that space available for swap. But I don't know how to do it :-/ Do you have any suggestion?
Thank you
Marco
partitioning lvm mate ubuntu-mate
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm facing an issue in my Ubuntu Mate 18.04 system.
I installed the file system in a LVM partition and would like to enlarge the swap space. I followed the instructions here but I get this message when I try to enlarge the partition
Insufficient free space: 512 extents needed, but only 0 available
This is the content of my disk according to fdisk -l
Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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
Disklabel type: gpt
Disk identifier: 8F28ED66-4E76-4B77-AB4B-D0AB345E21CA
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 488396799 487346176 232,4G Linux LVM
Disk /dev/mapper/ubuntu--mate--vg-root: 231,4 GiB, 248474763264 bytes, 485302272 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/ubuntu--mate--vg-swap_1: 996 MiB, 1044381696 bytes, 2039808 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
It seems like there's no free space left on the Physical volume in order to further enlarge the swap partition. If I type
sudo lvresize -l +100%FREE /dev/ubuntu-mate-vg/swap_1
I get
New size (249 extents) matches existing size (249 extents).
Therefore I'd like to shrink a bit (say, 5 Gb) my main partition vg-root and make that space available for swap. But I don't know how to do it :-/ Do you have any suggestion?
Thank you
Marco
partitioning lvm mate ubuntu-mate
I'm facing an issue in my Ubuntu Mate 18.04 system.
I installed the file system in a LVM partition and would like to enlarge the swap space. I followed the instructions here but I get this message when I try to enlarge the partition
Insufficient free space: 512 extents needed, but only 0 available
This is the content of my disk according to fdisk -l
Disk /dev/sda: 232,9 GiB, 250059350016 bytes, 488397168 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
Disklabel type: gpt
Disk identifier: 8F28ED66-4E76-4B77-AB4B-D0AB345E21CA
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 488396799 487346176 232,4G Linux LVM
Disk /dev/mapper/ubuntu--mate--vg-root: 231,4 GiB, 248474763264 bytes, 485302272 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/ubuntu--mate--vg-swap_1: 996 MiB, 1044381696 bytes, 2039808 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
It seems like there's no free space left on the Physical volume in order to further enlarge the swap partition. If I type
sudo lvresize -l +100%FREE /dev/ubuntu-mate-vg/swap_1
I get
New size (249 extents) matches existing size (249 extents).
Therefore I'd like to shrink a bit (say, 5 Gb) my main partition vg-root and make that space available for swap. But I don't know how to do it :-/ Do you have any suggestion?
Thank you
Marco
partitioning lvm mate ubuntu-mate
asked Apr 23 at 12:19
![](https://lh6.googleusercontent.com/-EuzOJJL4I2o/AAAAAAAAAAI/AAAAAAAAABU/ubCg3hVSHyg/photo.jpg?sz=32)
![](https://lh6.googleusercontent.com/-EuzOJJL4I2o/AAAAAAAAAAI/AAAAAAAAABU/ubCg3hVSHyg/photo.jpg?sz=32)
Marco Zanetti
362
362
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
I made it!
What I did was:
- install Ubuntu on a USB disk
- run ubuntu without installing it
- install KVPM on the live session
- Reduced the main disk partition from KVPM (just a few seconds)
- Expanded the swap partition from KVPM (just a few seconds again)
Then I rebooted the PC (with my fingers crossed) and I could see the new size of the mail partition but NOT the new - enlarged size of the swap.
What I did then was performing the following:
sudo swapoff /dev/ubuntu-mate-vg/swap_1
sudo mkswap /dev/ubuntu-mate-vg/swap_1
sudo swapon /dev/ubuntu-mate-vg/swap_1
Then the OS could see the whole swapping filesystem.
It wasn't easy so I wanted all of you to know about it.
1
Nice work that you got it right!
â George Udosen
Apr 23 at 14:27
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
I made it!
What I did was:
- install Ubuntu on a USB disk
- run ubuntu without installing it
- install KVPM on the live session
- Reduced the main disk partition from KVPM (just a few seconds)
- Expanded the swap partition from KVPM (just a few seconds again)
Then I rebooted the PC (with my fingers crossed) and I could see the new size of the mail partition but NOT the new - enlarged size of the swap.
What I did then was performing the following:
sudo swapoff /dev/ubuntu-mate-vg/swap_1
sudo mkswap /dev/ubuntu-mate-vg/swap_1
sudo swapon /dev/ubuntu-mate-vg/swap_1
Then the OS could see the whole swapping filesystem.
It wasn't easy so I wanted all of you to know about it.
1
Nice work that you got it right!
â George Udosen
Apr 23 at 14:27
add a comment |Â
up vote
2
down vote
I made it!
What I did was:
- install Ubuntu on a USB disk
- run ubuntu without installing it
- install KVPM on the live session
- Reduced the main disk partition from KVPM (just a few seconds)
- Expanded the swap partition from KVPM (just a few seconds again)
Then I rebooted the PC (with my fingers crossed) and I could see the new size of the mail partition but NOT the new - enlarged size of the swap.
What I did then was performing the following:
sudo swapoff /dev/ubuntu-mate-vg/swap_1
sudo mkswap /dev/ubuntu-mate-vg/swap_1
sudo swapon /dev/ubuntu-mate-vg/swap_1
Then the OS could see the whole swapping filesystem.
It wasn't easy so I wanted all of you to know about it.
1
Nice work that you got it right!
â George Udosen
Apr 23 at 14:27
add a comment |Â
up vote
2
down vote
up vote
2
down vote
I made it!
What I did was:
- install Ubuntu on a USB disk
- run ubuntu without installing it
- install KVPM on the live session
- Reduced the main disk partition from KVPM (just a few seconds)
- Expanded the swap partition from KVPM (just a few seconds again)
Then I rebooted the PC (with my fingers crossed) and I could see the new size of the mail partition but NOT the new - enlarged size of the swap.
What I did then was performing the following:
sudo swapoff /dev/ubuntu-mate-vg/swap_1
sudo mkswap /dev/ubuntu-mate-vg/swap_1
sudo swapon /dev/ubuntu-mate-vg/swap_1
Then the OS could see the whole swapping filesystem.
It wasn't easy so I wanted all of you to know about it.
I made it!
What I did was:
- install Ubuntu on a USB disk
- run ubuntu without installing it
- install KVPM on the live session
- Reduced the main disk partition from KVPM (just a few seconds)
- Expanded the swap partition from KVPM (just a few seconds again)
Then I rebooted the PC (with my fingers crossed) and I could see the new size of the mail partition but NOT the new - enlarged size of the swap.
What I did then was performing the following:
sudo swapoff /dev/ubuntu-mate-vg/swap_1
sudo mkswap /dev/ubuntu-mate-vg/swap_1
sudo swapon /dev/ubuntu-mate-vg/swap_1
Then the OS could see the whole swapping filesystem.
It wasn't easy so I wanted all of you to know about it.
answered Apr 23 at 13:46
![](https://lh6.googleusercontent.com/-EuzOJJL4I2o/AAAAAAAAAAI/AAAAAAAAABU/ubCg3hVSHyg/photo.jpg?sz=32)
![](https://lh6.googleusercontent.com/-EuzOJJL4I2o/AAAAAAAAAAI/AAAAAAAAABU/ubCg3hVSHyg/photo.jpg?sz=32)
Marco Zanetti
362
362
1
Nice work that you got it right!
â George Udosen
Apr 23 at 14:27
add a comment |Â
1
Nice work that you got it right!
â George Udosen
Apr 23 at 14:27
1
1
Nice work that you got it right!
â George Udosen
Apr 23 at 14:27
Nice work that you got it right!
â George Udosen
Apr 23 at 14:27
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1027446%2fshrinking-lvm-partition-in-order-to-enlarge-swap-on-ubuntu-mate-18-04%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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