Remove partition and enlarge partition
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am trying to delete my linux-swap partition /dev/sda5 and allocate the free space to /dev/sda6.
But when i try to delete sda5 GParted gives an error "You have to umount sda6".
But i can not umount sda6. I gives me the error "umount: /: target is busy"
If i reduce the size of sda5 i can not allocate the unallocated space to sda6.
Can anyone give me some advice on how to do this the right way?
I have a multi-boot system with windows and Linux. (Grub2)
partition
 |Â
show 1 more comment
up vote
1
down vote
favorite
I am trying to delete my linux-swap partition /dev/sda5 and allocate the free space to /dev/sda6.
But when i try to delete sda5 GParted gives an error "You have to umount sda6".
But i can not umount sda6. I gives me the error "umount: /: target is busy"
If i reduce the size of sda5 i can not allocate the unallocated space to sda6.
Can anyone give me some advice on how to do this the right way?
I have a multi-boot system with windows and Linux. (Grub2)
partition
1
Neither of those addresses his problem.
â Thomas Dickey
Jun 13 at 23:08
If you happen to be running a remote (no direct access) system, live media is of limited usefulness. If the system had been setup to use LVM, you could have changed that swap partition to another chunk of the volume group containing/
, and extended the filesystem with little impact.
â Thomas Dickey
Jun 13 at 23:50
@Dafnie, first you'll need to get the last sector of your swap partition. Review the output ofparted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your/
partition, abort this procedure. Otherwise make a note of the end sector of the swap partition. Next, turn off your swap partition withswapoff -a
. Next, edit/etc/fstab
and remove the entry for your swap partition...
â Emmanuel Rosa
Jun 14 at 15:26
...Next, delete the swap partition withparted /dev/sda rm 5
Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
. Next, resize the/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
. Finally, you can grow the filesystem online withresize2fs /dev/sdaROOT_PART_NUMBER_HERE
...
â Emmanuel Rosa
Jun 14 at 15:27
...Before running any of these commends, I highly recommend you have backups for everything; Basically you accept the possibility of wrecking your entire disk. And that you read the documentation for the commands so you know what they do and can adjust accordingly.
â Emmanuel Rosa
Jun 14 at 15:27
 |Â
show 1 more comment
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am trying to delete my linux-swap partition /dev/sda5 and allocate the free space to /dev/sda6.
But when i try to delete sda5 GParted gives an error "You have to umount sda6".
But i can not umount sda6. I gives me the error "umount: /: target is busy"
If i reduce the size of sda5 i can not allocate the unallocated space to sda6.
Can anyone give me some advice on how to do this the right way?
I have a multi-boot system with windows and Linux. (Grub2)
partition
I am trying to delete my linux-swap partition /dev/sda5 and allocate the free space to /dev/sda6.
But when i try to delete sda5 GParted gives an error "You have to umount sda6".
But i can not umount sda6. I gives me the error "umount: /: target is busy"
If i reduce the size of sda5 i can not allocate the unallocated space to sda6.
Can anyone give me some advice on how to do this the right way?
I have a multi-boot system with windows and Linux. (Grub2)
partition
asked Jun 13 at 22:52
Dafnie
113
113
1
Neither of those addresses his problem.
â Thomas Dickey
Jun 13 at 23:08
If you happen to be running a remote (no direct access) system, live media is of limited usefulness. If the system had been setup to use LVM, you could have changed that swap partition to another chunk of the volume group containing/
, and extended the filesystem with little impact.
â Thomas Dickey
Jun 13 at 23:50
@Dafnie, first you'll need to get the last sector of your swap partition. Review the output ofparted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your/
partition, abort this procedure. Otherwise make a note of the end sector of the swap partition. Next, turn off your swap partition withswapoff -a
. Next, edit/etc/fstab
and remove the entry for your swap partition...
â Emmanuel Rosa
Jun 14 at 15:26
...Next, delete the swap partition withparted /dev/sda rm 5
Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
. Next, resize the/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
. Finally, you can grow the filesystem online withresize2fs /dev/sdaROOT_PART_NUMBER_HERE
...
â Emmanuel Rosa
Jun 14 at 15:27
...Before running any of these commends, I highly recommend you have backups for everything; Basically you accept the possibility of wrecking your entire disk. And that you read the documentation for the commands so you know what they do and can adjust accordingly.
â Emmanuel Rosa
Jun 14 at 15:27
 |Â
show 1 more comment
1
Neither of those addresses his problem.
â Thomas Dickey
Jun 13 at 23:08
If you happen to be running a remote (no direct access) system, live media is of limited usefulness. If the system had been setup to use LVM, you could have changed that swap partition to another chunk of the volume group containing/
, and extended the filesystem with little impact.
â Thomas Dickey
Jun 13 at 23:50
@Dafnie, first you'll need to get the last sector of your swap partition. Review the output ofparted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your/
partition, abort this procedure. Otherwise make a note of the end sector of the swap partition. Next, turn off your swap partition withswapoff -a
. Next, edit/etc/fstab
and remove the entry for your swap partition...
â Emmanuel Rosa
Jun 14 at 15:26
...Next, delete the swap partition withparted /dev/sda rm 5
Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
. Next, resize the/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
. Finally, you can grow the filesystem online withresize2fs /dev/sdaROOT_PART_NUMBER_HERE
...
â Emmanuel Rosa
Jun 14 at 15:27
...Before running any of these commends, I highly recommend you have backups for everything; Basically you accept the possibility of wrecking your entire disk. And that you read the documentation for the commands so you know what they do and can adjust accordingly.
â Emmanuel Rosa
Jun 14 at 15:27
1
1
Neither of those addresses his problem.
â Thomas Dickey
Jun 13 at 23:08
Neither of those addresses his problem.
â Thomas Dickey
Jun 13 at 23:08
If you happen to be running a remote (no direct access) system, live media is of limited usefulness. If the system had been setup to use LVM, you could have changed that swap partition to another chunk of the volume group containing
/
, and extended the filesystem with little impact.â Thomas Dickey
Jun 13 at 23:50
If you happen to be running a remote (no direct access) system, live media is of limited usefulness. If the system had been setup to use LVM, you could have changed that swap partition to another chunk of the volume group containing
/
, and extended the filesystem with little impact.â Thomas Dickey
Jun 13 at 23:50
@Dafnie, first you'll need to get the last sector of your swap partition. Review the output of
parted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your /
partition, abort this procedure. Otherwise make a note of the end sector of the swap partition. Next, turn off your swap partition with swapoff -a
. Next, edit /etc/fstab
and remove the entry for your swap partition...â Emmanuel Rosa
Jun 14 at 15:26
@Dafnie, first you'll need to get the last sector of your swap partition. Review the output of
parted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your /
partition, abort this procedure. Otherwise make a note of the end sector of the swap partition. Next, turn off your swap partition with swapoff -a
. Next, edit /etc/fstab
and remove the entry for your swap partition...â Emmanuel Rosa
Jun 14 at 15:26
...Next, delete the swap partition with
parted /dev/sda rm 5
Removing that partition will likely change the partition number for /
, so run lsblk
to get the correct partition number for /
. Next, resize the /
partition with parted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
. Finally, you can grow the filesystem online with resize2fs /dev/sdaROOT_PART_NUMBER_HERE
...â Emmanuel Rosa
Jun 14 at 15:27
...Next, delete the swap partition with
parted /dev/sda rm 5
Removing that partition will likely change the partition number for /
, so run lsblk
to get the correct partition number for /
. Next, resize the /
partition with parted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
. Finally, you can grow the filesystem online with resize2fs /dev/sdaROOT_PART_NUMBER_HERE
...â Emmanuel Rosa
Jun 14 at 15:27
...Before running any of these commends, I highly recommend you have backups for everything; Basically you accept the possibility of wrecking your entire disk. And that you read the documentation for the commands so you know what they do and can adjust accordingly.
â Emmanuel Rosa
Jun 14 at 15:27
...Before running any of these commends, I highly recommend you have backups for everything; Basically you accept the possibility of wrecking your entire disk. And that you read the documentation for the commands so you know what they do and can adjust accordingly.
â Emmanuel Rosa
Jun 14 at 15:27
 |Â
show 1 more comment
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
As you can see in the image, sda6
is an ext4 partition that's mounted as /
. That's the main node of your system, so it will stay busy as long as the system is up. You need either a live USB/DVD session or to connect the drive under another running system and perform the operation from there.
Thanks for the answars. I booted on a Linux USB and removed the swapdrive this way. 1. Disabled swap by rightkliking the swapdrive. 2. Unmount the swapdrive. 3. Delete the swapdrive. 4. expand the / drive 5. Edit /etc/fstab and remove the entry for your swap partition.
â Dafnie
Jun 16 at 19:28
@Dafnie Well done.
â Tomasz
Jun 16 at 19:30
add a comment |Â
up vote
0
down vote
Here's how you can remove your swap partition and use the free/unallocated space for your /
partition.
Warning
But first... Before running any of these commands, I insist you have backups for everything. This is so important it's worth mentioning twice: no backups? Do not proceed.
By proceeding you accept the possibility of wrecking your entire disk. That's the nature of manipulating partitions.
Procedure
Get the last sector of your swap partition. Review the output of
parted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your / partition, abort this procedure. Otherwise make a note of the end sector of the swap partition.Turn off your swap partition with
swapoff -a
.Edit
/etc/fstab
and remove the entry for your swap partition.Delete the swap partition with
parted /dev/sda rm 5
. Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
.Resize the
/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
.Grow the filesystem online with
resize2fs /dev/sdaROOT_PART_NUMBER_HERE
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
As you can see in the image, sda6
is an ext4 partition that's mounted as /
. That's the main node of your system, so it will stay busy as long as the system is up. You need either a live USB/DVD session or to connect the drive under another running system and perform the operation from there.
Thanks for the answars. I booted on a Linux USB and removed the swapdrive this way. 1. Disabled swap by rightkliking the swapdrive. 2. Unmount the swapdrive. 3. Delete the swapdrive. 4. expand the / drive 5. Edit /etc/fstab and remove the entry for your swap partition.
â Dafnie
Jun 16 at 19:28
@Dafnie Well done.
â Tomasz
Jun 16 at 19:30
add a comment |Â
up vote
2
down vote
accepted
As you can see in the image, sda6
is an ext4 partition that's mounted as /
. That's the main node of your system, so it will stay busy as long as the system is up. You need either a live USB/DVD session or to connect the drive under another running system and perform the operation from there.
Thanks for the answars. I booted on a Linux USB and removed the swapdrive this way. 1. Disabled swap by rightkliking the swapdrive. 2. Unmount the swapdrive. 3. Delete the swapdrive. 4. expand the / drive 5. Edit /etc/fstab and remove the entry for your swap partition.
â Dafnie
Jun 16 at 19:28
@Dafnie Well done.
â Tomasz
Jun 16 at 19:30
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
As you can see in the image, sda6
is an ext4 partition that's mounted as /
. That's the main node of your system, so it will stay busy as long as the system is up. You need either a live USB/DVD session or to connect the drive under another running system and perform the operation from there.
As you can see in the image, sda6
is an ext4 partition that's mounted as /
. That's the main node of your system, so it will stay busy as long as the system is up. You need either a live USB/DVD session or to connect the drive under another running system and perform the operation from there.
answered Jun 13 at 23:14
Tomasz
8,03052560
8,03052560
Thanks for the answars. I booted on a Linux USB and removed the swapdrive this way. 1. Disabled swap by rightkliking the swapdrive. 2. Unmount the swapdrive. 3. Delete the swapdrive. 4. expand the / drive 5. Edit /etc/fstab and remove the entry for your swap partition.
â Dafnie
Jun 16 at 19:28
@Dafnie Well done.
â Tomasz
Jun 16 at 19:30
add a comment |Â
Thanks for the answars. I booted on a Linux USB and removed the swapdrive this way. 1. Disabled swap by rightkliking the swapdrive. 2. Unmount the swapdrive. 3. Delete the swapdrive. 4. expand the / drive 5. Edit /etc/fstab and remove the entry for your swap partition.
â Dafnie
Jun 16 at 19:28
@Dafnie Well done.
â Tomasz
Jun 16 at 19:30
Thanks for the answars. I booted on a Linux USB and removed the swapdrive this way. 1. Disabled swap by rightkliking the swapdrive. 2. Unmount the swapdrive. 3. Delete the swapdrive. 4. expand the / drive 5. Edit /etc/fstab and remove the entry for your swap partition.
â Dafnie
Jun 16 at 19:28
Thanks for the answars. I booted on a Linux USB and removed the swapdrive this way. 1. Disabled swap by rightkliking the swapdrive. 2. Unmount the swapdrive. 3. Delete the swapdrive. 4. expand the / drive 5. Edit /etc/fstab and remove the entry for your swap partition.
â Dafnie
Jun 16 at 19:28
@Dafnie Well done.
â Tomasz
Jun 16 at 19:30
@Dafnie Well done.
â Tomasz
Jun 16 at 19:30
add a comment |Â
up vote
0
down vote
Here's how you can remove your swap partition and use the free/unallocated space for your /
partition.
Warning
But first... Before running any of these commands, I insist you have backups for everything. This is so important it's worth mentioning twice: no backups? Do not proceed.
By proceeding you accept the possibility of wrecking your entire disk. That's the nature of manipulating partitions.
Procedure
Get the last sector of your swap partition. Review the output of
parted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your / partition, abort this procedure. Otherwise make a note of the end sector of the swap partition.Turn off your swap partition with
swapoff -a
.Edit
/etc/fstab
and remove the entry for your swap partition.Delete the swap partition with
parted /dev/sda rm 5
. Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
.Resize the
/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
.Grow the filesystem online with
resize2fs /dev/sdaROOT_PART_NUMBER_HERE
add a comment |Â
up vote
0
down vote
Here's how you can remove your swap partition and use the free/unallocated space for your /
partition.
Warning
But first... Before running any of these commands, I insist you have backups for everything. This is so important it's worth mentioning twice: no backups? Do not proceed.
By proceeding you accept the possibility of wrecking your entire disk. That's the nature of manipulating partitions.
Procedure
Get the last sector of your swap partition. Review the output of
parted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your / partition, abort this procedure. Otherwise make a note of the end sector of the swap partition.Turn off your swap partition with
swapoff -a
.Edit
/etc/fstab
and remove the entry for your swap partition.Delete the swap partition with
parted /dev/sda rm 5
. Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
.Resize the
/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
.Grow the filesystem online with
resize2fs /dev/sdaROOT_PART_NUMBER_HERE
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Here's how you can remove your swap partition and use the free/unallocated space for your /
partition.
Warning
But first... Before running any of these commands, I insist you have backups for everything. This is so important it's worth mentioning twice: no backups? Do not proceed.
By proceeding you accept the possibility of wrecking your entire disk. That's the nature of manipulating partitions.
Procedure
Get the last sector of your swap partition. Review the output of
parted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your / partition, abort this procedure. Otherwise make a note of the end sector of the swap partition.Turn off your swap partition with
swapoff -a
.Edit
/etc/fstab
and remove the entry for your swap partition.Delete the swap partition with
parted /dev/sda rm 5
. Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
.Resize the
/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
.Grow the filesystem online with
resize2fs /dev/sdaROOT_PART_NUMBER_HERE
Here's how you can remove your swap partition and use the free/unallocated space for your /
partition.
Warning
But first... Before running any of these commands, I insist you have backups for everything. This is so important it's worth mentioning twice: no backups? Do not proceed.
By proceeding you accept the possibility of wrecking your entire disk. That's the nature of manipulating partitions.
Procedure
Get the last sector of your swap partition. Review the output of
parted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your / partition, abort this procedure. Otherwise make a note of the end sector of the swap partition.Turn off your swap partition with
swapoff -a
.Edit
/etc/fstab
and remove the entry for your swap partition.Delete the swap partition with
parted /dev/sda rm 5
. Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
.Resize the
/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
.Grow the filesystem online with
resize2fs /dev/sdaROOT_PART_NUMBER_HERE
answered Jun 15 at 14:43
Emmanuel Rosa
2,1801410
2,1801410
add a comment |Â
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%2f449687%2fremove-partition-and-enlarge-partition%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
1
Neither of those addresses his problem.
â Thomas Dickey
Jun 13 at 23:08
If you happen to be running a remote (no direct access) system, live media is of limited usefulness. If the system had been setup to use LVM, you could have changed that swap partition to another chunk of the volume group containing
/
, and extended the filesystem with little impact.â Thomas Dickey
Jun 13 at 23:50
@Dafnie, first you'll need to get the last sector of your swap partition. Review the output of
parted /dev/sda unit s print
. If the start/end sector range of your swap partition is not AFTER the start/end range of your/
partition, abort this procedure. Otherwise make a note of the end sector of the swap partition. Next, turn off your swap partition withswapoff -a
. Next, edit/etc/fstab
and remove the entry for your swap partition...â Emmanuel Rosa
Jun 14 at 15:26
...Next, delete the swap partition with
parted /dev/sda rm 5
Removing that partition will likely change the partition number for/
, so runlsblk
to get the correct partition number for/
. Next, resize the/
partition withparted /dev/sda unit s resizepart ROOT_PART_NUMBER_HERE LAST_SECTOR_HERE
. Finally, you can grow the filesystem online withresize2fs /dev/sdaROOT_PART_NUMBER_HERE
...â Emmanuel Rosa
Jun 14 at 15:27
...Before running any of these commends, I highly recommend you have backups for everything; Basically you accept the possibility of wrecking your entire disk. And that you read the documentation for the commands so you know what they do and can adjust accordingly.
â Emmanuel Rosa
Jun 14 at 15:27