Want to increase partition sizes - how to do so safely?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm looking to resize a number of partitions, but I'm unsure how to go about doing this.
I want to increase the partition size of the /var
partition, that is in the middle of all the other partitions... I know that in order to keep data intact, the partition needs to start on the same block number as it was originally.
So my question is, even if there are partitions after /var
, can I resize it without disrupting the other partitions? Will it take more space from a different place? Or would it be best to create a new partition altogether, something like /var/log
down at the bottom? And if so, how do I do that?
Here's the current partition layout (I'm hoping I can just increase the size of /var/lib/mysql
easily enough since it's down at the bottom).
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/dm-0 19G 1.6G 16G 9% /
udev 10M 0 10M 0% /dev
tmpfs 7.9G 807M 7.1G 11% /run
tmpfs 20G 0 20G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 20G 0 20G 0% /sys/fs/cgroup
/dev/md0 291M 33M 243M 12% /boot
/dev/mapper/base-var 19G 11G 7.5G 59% /var
/dev/mapper/base-tmp 1.8G 3.0M 1.7G 1% /tmp
/dev/mapper/base-home 86G 35G 47G 43% /home
/dev/mapper/base-cyrus 75G 60G 12G 85% /var/spool/cyrus
/dev/mapper/base-www 20G 13G 5.6G 71% /var/www
/dev/mapper/base-mysql 60G 55G 2.3G 97% /var/lib/mysql
partition size resize2fs var
add a comment |Â
up vote
1
down vote
favorite
I'm looking to resize a number of partitions, but I'm unsure how to go about doing this.
I want to increase the partition size of the /var
partition, that is in the middle of all the other partitions... I know that in order to keep data intact, the partition needs to start on the same block number as it was originally.
So my question is, even if there are partitions after /var
, can I resize it without disrupting the other partitions? Will it take more space from a different place? Or would it be best to create a new partition altogether, something like /var/log
down at the bottom? And if so, how do I do that?
Here's the current partition layout (I'm hoping I can just increase the size of /var/lib/mysql
easily enough since it's down at the bottom).
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/dm-0 19G 1.6G 16G 9% /
udev 10M 0 10M 0% /dev
tmpfs 7.9G 807M 7.1G 11% /run
tmpfs 20G 0 20G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 20G 0 20G 0% /sys/fs/cgroup
/dev/md0 291M 33M 243M 12% /boot
/dev/mapper/base-var 19G 11G 7.5G 59% /var
/dev/mapper/base-tmp 1.8G 3.0M 1.7G 1% /tmp
/dev/mapper/base-home 86G 35G 47G 43% /home
/dev/mapper/base-cyrus 75G 60G 12G 85% /var/spool/cyrus
/dev/mapper/base-www 20G 13G 5.6G 71% /var/www
/dev/mapper/base-mysql 60G 55G 2.3G 97% /var/lib/mysql
partition size resize2fs var
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm looking to resize a number of partitions, but I'm unsure how to go about doing this.
I want to increase the partition size of the /var
partition, that is in the middle of all the other partitions... I know that in order to keep data intact, the partition needs to start on the same block number as it was originally.
So my question is, even if there are partitions after /var
, can I resize it without disrupting the other partitions? Will it take more space from a different place? Or would it be best to create a new partition altogether, something like /var/log
down at the bottom? And if so, how do I do that?
Here's the current partition layout (I'm hoping I can just increase the size of /var/lib/mysql
easily enough since it's down at the bottom).
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/dm-0 19G 1.6G 16G 9% /
udev 10M 0 10M 0% /dev
tmpfs 7.9G 807M 7.1G 11% /run
tmpfs 20G 0 20G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 20G 0 20G 0% /sys/fs/cgroup
/dev/md0 291M 33M 243M 12% /boot
/dev/mapper/base-var 19G 11G 7.5G 59% /var
/dev/mapper/base-tmp 1.8G 3.0M 1.7G 1% /tmp
/dev/mapper/base-home 86G 35G 47G 43% /home
/dev/mapper/base-cyrus 75G 60G 12G 85% /var/spool/cyrus
/dev/mapper/base-www 20G 13G 5.6G 71% /var/www
/dev/mapper/base-mysql 60G 55G 2.3G 97% /var/lib/mysql
partition size resize2fs var
I'm looking to resize a number of partitions, but I'm unsure how to go about doing this.
I want to increase the partition size of the /var
partition, that is in the middle of all the other partitions... I know that in order to keep data intact, the partition needs to start on the same block number as it was originally.
So my question is, even if there are partitions after /var
, can I resize it without disrupting the other partitions? Will it take more space from a different place? Or would it be best to create a new partition altogether, something like /var/log
down at the bottom? And if so, how do I do that?
Here's the current partition layout (I'm hoping I can just increase the size of /var/lib/mysql
easily enough since it's down at the bottom).
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/dm-0 19G 1.6G 16G 9% /
udev 10M 0 10M 0% /dev
tmpfs 7.9G 807M 7.1G 11% /run
tmpfs 20G 0 20G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 20G 0 20G 0% /sys/fs/cgroup
/dev/md0 291M 33M 243M 12% /boot
/dev/mapper/base-var 19G 11G 7.5G 59% /var
/dev/mapper/base-tmp 1.8G 3.0M 1.7G 1% /tmp
/dev/mapper/base-home 86G 35G 47G 43% /home
/dev/mapper/base-cyrus 75G 60G 12G 85% /var/spool/cyrus
/dev/mapper/base-www 20G 13G 5.6G 71% /var/www
/dev/mapper/base-mysql 60G 55G 2.3G 97% /var/lib/mysql
partition size resize2fs var
edited Feb 8 at 1:53
Jeff Schaller
31.3k846105
31.3k846105
asked Feb 8 at 0:26
Becca Hoek
62
62
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
Since you are using LVM instead of conventional partitions, you don't need to worry much about where they are on disk. As long as you have free space in the volume group, you can grow a logical volume with lvresize
. You can then grow the filesystem in that logical volume with resize2fs
, assuming it is ext4.
Use pvs
to see how much space is used/free on the physical volumes in your volume group.
wow, that's excellent, thank you.
â Becca Hoek
Feb 12 at 20:12
add a comment |Â
up vote
0
down vote
Partitioning tools
To resize partitions that are in-use on an already installed operating system, it is recommended to use a tool such as GParted (GNOME Partition Editor) by creating a USB disk or other bootable medium with the appropriate live ISO image.
The GParted live ISO allows for mouse and keyboard interaction with mounted volumes, and has a very extensive manual available here.
Creating space for /var
Can I resize it (
/var
) without disrupting the other partitions?
To resize /var
, you'll need to create free (unallocated) space first by shrinking another one of your partitions (assuming that you have all possible space currently allocated to a partition).
You can create unallocated space from any partition that is not full by shrinking it; however, you'll want to ensure that the free space is taken from the end of the partition being shrunken in order to ensure no data loss.
The unallocated space should then be moved to post-fix the /var
partition. Once the unallocated space has been moved, /var
can be resized to take up as much as the free space as needed.
Will it take more space from a different place?
GParted cannot dynamically move unallocated space or take allocated space from another partition to the fit user's desires, thus the previous step of shrinking a partition and moving the unallocated space is necessary.
Or would it be best to create a new partition altogether, something like
/var/log
down at the bottom? And if so, how do I do that?
To answer your first question, it's up to your needs and what suits you best. It's hard to judge what your use-cases are and thus what suits your situation.
To answer your second question, you'd need to create unallocated space by shrinking a volume within GParted. You can then move the unallocated space to the end of the volume, and right-click on the free space to create a new partition, with the filesystem format that you need.
Ensuring order of partitions remains constant
The identifiers for each partition (for example: /dev/sdb1
or /dev/sdb3
) are determined by the order of the partitions on the volume. To ensure continuity of the order of partitions after performing operations, you'll simply need to reorder the partitions as needed through move operations until the desired order is achieved.
This would be a good answer if the OP weren't using LVM
â psusi
Feb 8 at 2:51
Oops, I totally totally missed that... This answer is pretty useless now!
â aliceinpalth
Feb 8 at 2:56
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Since you are using LVM instead of conventional partitions, you don't need to worry much about where they are on disk. As long as you have free space in the volume group, you can grow a logical volume with lvresize
. You can then grow the filesystem in that logical volume with resize2fs
, assuming it is ext4.
Use pvs
to see how much space is used/free on the physical volumes in your volume group.
wow, that's excellent, thank you.
â Becca Hoek
Feb 12 at 20:12
add a comment |Â
up vote
1
down vote
Since you are using LVM instead of conventional partitions, you don't need to worry much about where they are on disk. As long as you have free space in the volume group, you can grow a logical volume with lvresize
. You can then grow the filesystem in that logical volume with resize2fs
, assuming it is ext4.
Use pvs
to see how much space is used/free on the physical volumes in your volume group.
wow, that's excellent, thank you.
â Becca Hoek
Feb 12 at 20:12
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Since you are using LVM instead of conventional partitions, you don't need to worry much about where they are on disk. As long as you have free space in the volume group, you can grow a logical volume with lvresize
. You can then grow the filesystem in that logical volume with resize2fs
, assuming it is ext4.
Use pvs
to see how much space is used/free on the physical volumes in your volume group.
Since you are using LVM instead of conventional partitions, you don't need to worry much about where they are on disk. As long as you have free space in the volume group, you can grow a logical volume with lvresize
. You can then grow the filesystem in that logical volume with resize2fs
, assuming it is ext4.
Use pvs
to see how much space is used/free on the physical volumes in your volume group.
answered Feb 8 at 2:54
psusi
13.2k22338
13.2k22338
wow, that's excellent, thank you.
â Becca Hoek
Feb 12 at 20:12
add a comment |Â
wow, that's excellent, thank you.
â Becca Hoek
Feb 12 at 20:12
wow, that's excellent, thank you.
â Becca Hoek
Feb 12 at 20:12
wow, that's excellent, thank you.
â Becca Hoek
Feb 12 at 20:12
add a comment |Â
up vote
0
down vote
Partitioning tools
To resize partitions that are in-use on an already installed operating system, it is recommended to use a tool such as GParted (GNOME Partition Editor) by creating a USB disk or other bootable medium with the appropriate live ISO image.
The GParted live ISO allows for mouse and keyboard interaction with mounted volumes, and has a very extensive manual available here.
Creating space for /var
Can I resize it (
/var
) without disrupting the other partitions?
To resize /var
, you'll need to create free (unallocated) space first by shrinking another one of your partitions (assuming that you have all possible space currently allocated to a partition).
You can create unallocated space from any partition that is not full by shrinking it; however, you'll want to ensure that the free space is taken from the end of the partition being shrunken in order to ensure no data loss.
The unallocated space should then be moved to post-fix the /var
partition. Once the unallocated space has been moved, /var
can be resized to take up as much as the free space as needed.
Will it take more space from a different place?
GParted cannot dynamically move unallocated space or take allocated space from another partition to the fit user's desires, thus the previous step of shrinking a partition and moving the unallocated space is necessary.
Or would it be best to create a new partition altogether, something like
/var/log
down at the bottom? And if so, how do I do that?
To answer your first question, it's up to your needs and what suits you best. It's hard to judge what your use-cases are and thus what suits your situation.
To answer your second question, you'd need to create unallocated space by shrinking a volume within GParted. You can then move the unallocated space to the end of the volume, and right-click on the free space to create a new partition, with the filesystem format that you need.
Ensuring order of partitions remains constant
The identifiers for each partition (for example: /dev/sdb1
or /dev/sdb3
) are determined by the order of the partitions on the volume. To ensure continuity of the order of partitions after performing operations, you'll simply need to reorder the partitions as needed through move operations until the desired order is achieved.
This would be a good answer if the OP weren't using LVM
â psusi
Feb 8 at 2:51
Oops, I totally totally missed that... This answer is pretty useless now!
â aliceinpalth
Feb 8 at 2:56
add a comment |Â
up vote
0
down vote
Partitioning tools
To resize partitions that are in-use on an already installed operating system, it is recommended to use a tool such as GParted (GNOME Partition Editor) by creating a USB disk or other bootable medium with the appropriate live ISO image.
The GParted live ISO allows for mouse and keyboard interaction with mounted volumes, and has a very extensive manual available here.
Creating space for /var
Can I resize it (
/var
) without disrupting the other partitions?
To resize /var
, you'll need to create free (unallocated) space first by shrinking another one of your partitions (assuming that you have all possible space currently allocated to a partition).
You can create unallocated space from any partition that is not full by shrinking it; however, you'll want to ensure that the free space is taken from the end of the partition being shrunken in order to ensure no data loss.
The unallocated space should then be moved to post-fix the /var
partition. Once the unallocated space has been moved, /var
can be resized to take up as much as the free space as needed.
Will it take more space from a different place?
GParted cannot dynamically move unallocated space or take allocated space from another partition to the fit user's desires, thus the previous step of shrinking a partition and moving the unallocated space is necessary.
Or would it be best to create a new partition altogether, something like
/var/log
down at the bottom? And if so, how do I do that?
To answer your first question, it's up to your needs and what suits you best. It's hard to judge what your use-cases are and thus what suits your situation.
To answer your second question, you'd need to create unallocated space by shrinking a volume within GParted. You can then move the unallocated space to the end of the volume, and right-click on the free space to create a new partition, with the filesystem format that you need.
Ensuring order of partitions remains constant
The identifiers for each partition (for example: /dev/sdb1
or /dev/sdb3
) are determined by the order of the partitions on the volume. To ensure continuity of the order of partitions after performing operations, you'll simply need to reorder the partitions as needed through move operations until the desired order is achieved.
This would be a good answer if the OP weren't using LVM
â psusi
Feb 8 at 2:51
Oops, I totally totally missed that... This answer is pretty useless now!
â aliceinpalth
Feb 8 at 2:56
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Partitioning tools
To resize partitions that are in-use on an already installed operating system, it is recommended to use a tool such as GParted (GNOME Partition Editor) by creating a USB disk or other bootable medium with the appropriate live ISO image.
The GParted live ISO allows for mouse and keyboard interaction with mounted volumes, and has a very extensive manual available here.
Creating space for /var
Can I resize it (
/var
) without disrupting the other partitions?
To resize /var
, you'll need to create free (unallocated) space first by shrinking another one of your partitions (assuming that you have all possible space currently allocated to a partition).
You can create unallocated space from any partition that is not full by shrinking it; however, you'll want to ensure that the free space is taken from the end of the partition being shrunken in order to ensure no data loss.
The unallocated space should then be moved to post-fix the /var
partition. Once the unallocated space has been moved, /var
can be resized to take up as much as the free space as needed.
Will it take more space from a different place?
GParted cannot dynamically move unallocated space or take allocated space from another partition to the fit user's desires, thus the previous step of shrinking a partition and moving the unallocated space is necessary.
Or would it be best to create a new partition altogether, something like
/var/log
down at the bottom? And if so, how do I do that?
To answer your first question, it's up to your needs and what suits you best. It's hard to judge what your use-cases are and thus what suits your situation.
To answer your second question, you'd need to create unallocated space by shrinking a volume within GParted. You can then move the unallocated space to the end of the volume, and right-click on the free space to create a new partition, with the filesystem format that you need.
Ensuring order of partitions remains constant
The identifiers for each partition (for example: /dev/sdb1
or /dev/sdb3
) are determined by the order of the partitions on the volume. To ensure continuity of the order of partitions after performing operations, you'll simply need to reorder the partitions as needed through move operations until the desired order is achieved.
Partitioning tools
To resize partitions that are in-use on an already installed operating system, it is recommended to use a tool such as GParted (GNOME Partition Editor) by creating a USB disk or other bootable medium with the appropriate live ISO image.
The GParted live ISO allows for mouse and keyboard interaction with mounted volumes, and has a very extensive manual available here.
Creating space for /var
Can I resize it (
/var
) without disrupting the other partitions?
To resize /var
, you'll need to create free (unallocated) space first by shrinking another one of your partitions (assuming that you have all possible space currently allocated to a partition).
You can create unallocated space from any partition that is not full by shrinking it; however, you'll want to ensure that the free space is taken from the end of the partition being shrunken in order to ensure no data loss.
The unallocated space should then be moved to post-fix the /var
partition. Once the unallocated space has been moved, /var
can be resized to take up as much as the free space as needed.
Will it take more space from a different place?
GParted cannot dynamically move unallocated space or take allocated space from another partition to the fit user's desires, thus the previous step of shrinking a partition and moving the unallocated space is necessary.
Or would it be best to create a new partition altogether, something like
/var/log
down at the bottom? And if so, how do I do that?
To answer your first question, it's up to your needs and what suits you best. It's hard to judge what your use-cases are and thus what suits your situation.
To answer your second question, you'd need to create unallocated space by shrinking a volume within GParted. You can then move the unallocated space to the end of the volume, and right-click on the free space to create a new partition, with the filesystem format that you need.
Ensuring order of partitions remains constant
The identifiers for each partition (for example: /dev/sdb1
or /dev/sdb3
) are determined by the order of the partitions on the volume. To ensure continuity of the order of partitions after performing operations, you'll simply need to reorder the partitions as needed through move operations until the desired order is achieved.
edited Feb 8 at 1:21
answered Feb 8 at 1:08
aliceinpalth
760116
760116
This would be a good answer if the OP weren't using LVM
â psusi
Feb 8 at 2:51
Oops, I totally totally missed that... This answer is pretty useless now!
â aliceinpalth
Feb 8 at 2:56
add a comment |Â
This would be a good answer if the OP weren't using LVM
â psusi
Feb 8 at 2:51
Oops, I totally totally missed that... This answer is pretty useless now!
â aliceinpalth
Feb 8 at 2:56
This would be a good answer if the OP weren't using LVM
â psusi
Feb 8 at 2:51
This would be a good answer if the OP weren't using LVM
â psusi
Feb 8 at 2:51
Oops, I totally totally missed that... This answer is pretty useless now!
â aliceinpalth
Feb 8 at 2:56
Oops, I totally totally missed that... This answer is pretty useless now!
â aliceinpalth
Feb 8 at 2:56
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422690%2fwant-to-increase-partition-sizes-how-to-do-so-safely%23new-answer', 'question_page');
);
Post as a guest
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
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
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