How to extend size of mounted ext4 /home gpt partition without loss of data?
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I have GPT partitioning for my drive:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: 8E38B9BD-5EA6-40F6-9C2B-98E5F801B29D
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 59643903 58593280 28G Linux filesystem
/dev/sda3 59643904 90894335 31250432 14.9G Linux swap
/dev/sda4 90894336 588941311 498046976 237.5G Linux filesystem
/dev/sda5 588941312 976771071 387829760 185G Linux filesystem
$ mount | grep /dev/sda
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda4 on /home type ext4 (rw,relatime,data=ordered)
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
âÂÂâÂÂsda1 8:1 0 512M 0 part
âÂÂâÂÂsda2 8:2 0 28G 0 part /
âÂÂâÂÂsda3 8:3 0 14.9G 0 part [SWAP]
âÂÂâÂÂsda4 8:4 0 237.5G 0 part /home
âÂÂâÂÂsda5 8:5 0 185G 0 part
sr0 11:0 1 1024M 0 rom
The sda5
partition was meant to be /media/DATA
partition, but I changed my mind, and I am using the /home
to store my data. But, the /home
is almost full, now.
How can I grow (+100GB
) mounted /home
partition without loss of data?
filesystems ext4 gpt
add a comment |Â
up vote
-1
down vote
favorite
I have GPT partitioning for my drive:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: 8E38B9BD-5EA6-40F6-9C2B-98E5F801B29D
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 59643903 58593280 28G Linux filesystem
/dev/sda3 59643904 90894335 31250432 14.9G Linux swap
/dev/sda4 90894336 588941311 498046976 237.5G Linux filesystem
/dev/sda5 588941312 976771071 387829760 185G Linux filesystem
$ mount | grep /dev/sda
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda4 on /home type ext4 (rw,relatime,data=ordered)
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
âÂÂâÂÂsda1 8:1 0 512M 0 part
âÂÂâÂÂsda2 8:2 0 28G 0 part /
âÂÂâÂÂsda3 8:3 0 14.9G 0 part [SWAP]
âÂÂâÂÂsda4 8:4 0 237.5G 0 part /home
âÂÂâÂÂsda5 8:5 0 185G 0 part
sr0 11:0 1 1024M 0 rom
The sda5
partition was meant to be /media/DATA
partition, but I changed my mind, and I am using the /home
to store my data. But, the /home
is almost full, now.
How can I grow (+100GB
) mounted /home
partition without loss of data?
filesystems ext4 gpt
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I have GPT partitioning for my drive:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: 8E38B9BD-5EA6-40F6-9C2B-98E5F801B29D
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 59643903 58593280 28G Linux filesystem
/dev/sda3 59643904 90894335 31250432 14.9G Linux swap
/dev/sda4 90894336 588941311 498046976 237.5G Linux filesystem
/dev/sda5 588941312 976771071 387829760 185G Linux filesystem
$ mount | grep /dev/sda
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda4 on /home type ext4 (rw,relatime,data=ordered)
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
âÂÂâÂÂsda1 8:1 0 512M 0 part
âÂÂâÂÂsda2 8:2 0 28G 0 part /
âÂÂâÂÂsda3 8:3 0 14.9G 0 part [SWAP]
âÂÂâÂÂsda4 8:4 0 237.5G 0 part /home
âÂÂâÂÂsda5 8:5 0 185G 0 part
sr0 11:0 1 1024M 0 rom
The sda5
partition was meant to be /media/DATA
partition, but I changed my mind, and I am using the /home
to store my data. But, the /home
is almost full, now.
How can I grow (+100GB
) mounted /home
partition without loss of data?
filesystems ext4 gpt
I have GPT partitioning for my drive:
$ sudo fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: 8E38B9BD-5EA6-40F6-9C2B-98E5F801B29D
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 59643903 58593280 28G Linux filesystem
/dev/sda3 59643904 90894335 31250432 14.9G Linux swap
/dev/sda4 90894336 588941311 498046976 237.5G Linux filesystem
/dev/sda5 588941312 976771071 387829760 185G Linux filesystem
$ mount | grep /dev/sda
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda4 on /home type ext4 (rw,relatime,data=ordered)
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
âÂÂâÂÂsda1 8:1 0 512M 0 part
âÂÂâÂÂsda2 8:2 0 28G 0 part /
âÂÂâÂÂsda3 8:3 0 14.9G 0 part [SWAP]
âÂÂâÂÂsda4 8:4 0 237.5G 0 part /home
âÂÂâÂÂsda5 8:5 0 185G 0 part
sr0 11:0 1 1024M 0 rom
The sda5
partition was meant to be /media/DATA
partition, but I changed my mind, and I am using the /home
to store my data. But, the /home
is almost full, now.
How can I grow (+100GB
) mounted /home
partition without loss of data?
filesystems ext4 gpt
asked May 27 at 10:46
kravemir
1,41621937
1,41621937
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
I haven't used fdisk
in a long time. I use gdisk
, and with gdisk
you can delete /dev/sda5
, and then delete /dev/sda4
, and then create sda4 again with same beginning offset (be careful) as before, but with size set to what you want it to be. Once that's done, save, and exit. You may be required to run partprobe
(from parted
) to refresh the /proc/partitions
. Once /proc/partitions
is refreshed with updated size of /dev/sda4
, and /dev/sda5
gone, then run resize2fs /dev/sda4
to resize it. Also in fdisk
before making any changes, make sure to set display units to sectors (using u
command).
Do you know whether size changes (orpartprobe
updates in general) affect mounted partitions?
â Hauke Laging
May 27 at 11:50
1
the best to affect in-use partitions is to run partx: after having done the gdisk voodoo,partx -u /dev/sda4
would update it (perhaps partx -d /dev/sda5 would be needed no idea)., it can be checked by looking at the content of/sys/class/block/sda4/size
before and after partx
â A.B
May 27 at 12:15
@HaukeLaging --- IIRC, devices in use/mounted will not see these changes.
â Ashish
May 28 at 12:59
But then your proposal is not going to work, is it?
â Hauke Laging
May 28 at 17:20
@HaukeLaging, I think withpartx -d ...
, andpartx -u ...
mentioned by @A.B, instead ofpartprobe
the instructions will work
â Ashish
May 29 at 17:35
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I haven't used fdisk
in a long time. I use gdisk
, and with gdisk
you can delete /dev/sda5
, and then delete /dev/sda4
, and then create sda4 again with same beginning offset (be careful) as before, but with size set to what you want it to be. Once that's done, save, and exit. You may be required to run partprobe
(from parted
) to refresh the /proc/partitions
. Once /proc/partitions
is refreshed with updated size of /dev/sda4
, and /dev/sda5
gone, then run resize2fs /dev/sda4
to resize it. Also in fdisk
before making any changes, make sure to set display units to sectors (using u
command).
Do you know whether size changes (orpartprobe
updates in general) affect mounted partitions?
â Hauke Laging
May 27 at 11:50
1
the best to affect in-use partitions is to run partx: after having done the gdisk voodoo,partx -u /dev/sda4
would update it (perhaps partx -d /dev/sda5 would be needed no idea)., it can be checked by looking at the content of/sys/class/block/sda4/size
before and after partx
â A.B
May 27 at 12:15
@HaukeLaging --- IIRC, devices in use/mounted will not see these changes.
â Ashish
May 28 at 12:59
But then your proposal is not going to work, is it?
â Hauke Laging
May 28 at 17:20
@HaukeLaging, I think withpartx -d ...
, andpartx -u ...
mentioned by @A.B, instead ofpartprobe
the instructions will work
â Ashish
May 29 at 17:35
add a comment |Â
up vote
1
down vote
I haven't used fdisk
in a long time. I use gdisk
, and with gdisk
you can delete /dev/sda5
, and then delete /dev/sda4
, and then create sda4 again with same beginning offset (be careful) as before, but with size set to what you want it to be. Once that's done, save, and exit. You may be required to run partprobe
(from parted
) to refresh the /proc/partitions
. Once /proc/partitions
is refreshed with updated size of /dev/sda4
, and /dev/sda5
gone, then run resize2fs /dev/sda4
to resize it. Also in fdisk
before making any changes, make sure to set display units to sectors (using u
command).
Do you know whether size changes (orpartprobe
updates in general) affect mounted partitions?
â Hauke Laging
May 27 at 11:50
1
the best to affect in-use partitions is to run partx: after having done the gdisk voodoo,partx -u /dev/sda4
would update it (perhaps partx -d /dev/sda5 would be needed no idea)., it can be checked by looking at the content of/sys/class/block/sda4/size
before and after partx
â A.B
May 27 at 12:15
@HaukeLaging --- IIRC, devices in use/mounted will not see these changes.
â Ashish
May 28 at 12:59
But then your proposal is not going to work, is it?
â Hauke Laging
May 28 at 17:20
@HaukeLaging, I think withpartx -d ...
, andpartx -u ...
mentioned by @A.B, instead ofpartprobe
the instructions will work
â Ashish
May 29 at 17:35
add a comment |Â
up vote
1
down vote
up vote
1
down vote
I haven't used fdisk
in a long time. I use gdisk
, and with gdisk
you can delete /dev/sda5
, and then delete /dev/sda4
, and then create sda4 again with same beginning offset (be careful) as before, but with size set to what you want it to be. Once that's done, save, and exit. You may be required to run partprobe
(from parted
) to refresh the /proc/partitions
. Once /proc/partitions
is refreshed with updated size of /dev/sda4
, and /dev/sda5
gone, then run resize2fs /dev/sda4
to resize it. Also in fdisk
before making any changes, make sure to set display units to sectors (using u
command).
I haven't used fdisk
in a long time. I use gdisk
, and with gdisk
you can delete /dev/sda5
, and then delete /dev/sda4
, and then create sda4 again with same beginning offset (be careful) as before, but with size set to what you want it to be. Once that's done, save, and exit. You may be required to run partprobe
(from parted
) to refresh the /proc/partitions
. Once /proc/partitions
is refreshed with updated size of /dev/sda4
, and /dev/sda5
gone, then run resize2fs /dev/sda4
to resize it. Also in fdisk
before making any changes, make sure to set display units to sectors (using u
command).
answered May 27 at 11:19
Ashish
1462
1462
Do you know whether size changes (orpartprobe
updates in general) affect mounted partitions?
â Hauke Laging
May 27 at 11:50
1
the best to affect in-use partitions is to run partx: after having done the gdisk voodoo,partx -u /dev/sda4
would update it (perhaps partx -d /dev/sda5 would be needed no idea)., it can be checked by looking at the content of/sys/class/block/sda4/size
before and after partx
â A.B
May 27 at 12:15
@HaukeLaging --- IIRC, devices in use/mounted will not see these changes.
â Ashish
May 28 at 12:59
But then your proposal is not going to work, is it?
â Hauke Laging
May 28 at 17:20
@HaukeLaging, I think withpartx -d ...
, andpartx -u ...
mentioned by @A.B, instead ofpartprobe
the instructions will work
â Ashish
May 29 at 17:35
add a comment |Â
Do you know whether size changes (orpartprobe
updates in general) affect mounted partitions?
â Hauke Laging
May 27 at 11:50
1
the best to affect in-use partitions is to run partx: after having done the gdisk voodoo,partx -u /dev/sda4
would update it (perhaps partx -d /dev/sda5 would be needed no idea)., it can be checked by looking at the content of/sys/class/block/sda4/size
before and after partx
â A.B
May 27 at 12:15
@HaukeLaging --- IIRC, devices in use/mounted will not see these changes.
â Ashish
May 28 at 12:59
But then your proposal is not going to work, is it?
â Hauke Laging
May 28 at 17:20
@HaukeLaging, I think withpartx -d ...
, andpartx -u ...
mentioned by @A.B, instead ofpartprobe
the instructions will work
â Ashish
May 29 at 17:35
Do you know whether size changes (or
partprobe
updates in general) affect mounted partitions?â Hauke Laging
May 27 at 11:50
Do you know whether size changes (or
partprobe
updates in general) affect mounted partitions?â Hauke Laging
May 27 at 11:50
1
1
the best to affect in-use partitions is to run partx: after having done the gdisk voodoo,
partx -u /dev/sda4
would update it (perhaps partx -d /dev/sda5 would be needed no idea)., it can be checked by looking at the content of /sys/class/block/sda4/size
before and after partxâ A.B
May 27 at 12:15
the best to affect in-use partitions is to run partx: after having done the gdisk voodoo,
partx -u /dev/sda4
would update it (perhaps partx -d /dev/sda5 would be needed no idea)., it can be checked by looking at the content of /sys/class/block/sda4/size
before and after partxâ A.B
May 27 at 12:15
@HaukeLaging --- IIRC, devices in use/mounted will not see these changes.
â Ashish
May 28 at 12:59
@HaukeLaging --- IIRC, devices in use/mounted will not see these changes.
â Ashish
May 28 at 12:59
But then your proposal is not going to work, is it?
â Hauke Laging
May 28 at 17:20
But then your proposal is not going to work, is it?
â Hauke Laging
May 28 at 17:20
@HaukeLaging, I think with
partx -d ...
, and partx -u ...
mentioned by @A.B, instead of partprobe
the instructions will workâ Ashish
May 29 at 17:35
@HaukeLaging, I think with
partx -d ...
, and partx -u ...
mentioned by @A.B, instead of partprobe
the instructions will workâ Ashish
May 29 at 17:35
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%2f446299%2fhow-to-extend-size-of-mounted-ext4-home-gpt-partition-without-loss-of-data%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