Increasing partition of a SD card
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a SD card that has two partitions /dev/sdb1
that holds the boot sector, and /dev/sdb2
that holds the OS. The card still has unpartitioned free space.
How can I take all the unpartitioned free space and add it to /dev/sdb2
without formatting the drive? I want to do this in on command line only
linux ubuntu partition fsck
add a comment |
up vote
0
down vote
favorite
I have a SD card that has two partitions /dev/sdb1
that holds the boot sector, and /dev/sdb2
that holds the OS. The card still has unpartitioned free space.
How can I take all the unpartitioned free space and add it to /dev/sdb2
without formatting the drive? I want to do this in on command line only
linux ubuntu partition fsck
Seeman resize2fs
.
– goldilocks
Sep 23 '15 at 19:04
The sequence of steps is: 1. resize the partition, using any appropriate tool (fdisk
,cfdisk
,gdisk
, &c.), and 2. resize the filesystem, usingresize2fs
(most likely; there are different tools for different FSs). If you want, you can usegparted
to do it automatically.
– Tom Hunt
Sep 23 '15 at 20:17
@goldilocks, I did useresize2fs
but it says I am already at full block. When I runparted /dev/sdd/ print free
, I have a whole chunk of Free Space. I want to allocate that to my parition
– Kousha
Sep 23 '15 at 20:48
Whoops! You have to increase the partition first w/fdisk
. Resize2fs resizes the filesystem inside. I don't have time to write a complete answer right now, but the fdisk thing means "deleting" the partition then creating it again with the exact same starting block, but then a greater final size. It's pretty straightforward, but you may want to look for an intro to fdisk or something if you haven't used it before.
– goldilocks
Sep 23 '15 at 21:14
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a SD card that has two partitions /dev/sdb1
that holds the boot sector, and /dev/sdb2
that holds the OS. The card still has unpartitioned free space.
How can I take all the unpartitioned free space and add it to /dev/sdb2
without formatting the drive? I want to do this in on command line only
linux ubuntu partition fsck
I have a SD card that has two partitions /dev/sdb1
that holds the boot sector, and /dev/sdb2
that holds the OS. The card still has unpartitioned free space.
How can I take all the unpartitioned free space and add it to /dev/sdb2
without formatting the drive? I want to do this in on command line only
linux ubuntu partition fsck
linux ubuntu partition fsck
edited Sep 23 '15 at 19:02
asked Sep 23 '15 at 18:55
Kousha
285316
285316
Seeman resize2fs
.
– goldilocks
Sep 23 '15 at 19:04
The sequence of steps is: 1. resize the partition, using any appropriate tool (fdisk
,cfdisk
,gdisk
, &c.), and 2. resize the filesystem, usingresize2fs
(most likely; there are different tools for different FSs). If you want, you can usegparted
to do it automatically.
– Tom Hunt
Sep 23 '15 at 20:17
@goldilocks, I did useresize2fs
but it says I am already at full block. When I runparted /dev/sdd/ print free
, I have a whole chunk of Free Space. I want to allocate that to my parition
– Kousha
Sep 23 '15 at 20:48
Whoops! You have to increase the partition first w/fdisk
. Resize2fs resizes the filesystem inside. I don't have time to write a complete answer right now, but the fdisk thing means "deleting" the partition then creating it again with the exact same starting block, but then a greater final size. It's pretty straightforward, but you may want to look for an intro to fdisk or something if you haven't used it before.
– goldilocks
Sep 23 '15 at 21:14
add a comment |
Seeman resize2fs
.
– goldilocks
Sep 23 '15 at 19:04
The sequence of steps is: 1. resize the partition, using any appropriate tool (fdisk
,cfdisk
,gdisk
, &c.), and 2. resize the filesystem, usingresize2fs
(most likely; there are different tools for different FSs). If you want, you can usegparted
to do it automatically.
– Tom Hunt
Sep 23 '15 at 20:17
@goldilocks, I did useresize2fs
but it says I am already at full block. When I runparted /dev/sdd/ print free
, I have a whole chunk of Free Space. I want to allocate that to my parition
– Kousha
Sep 23 '15 at 20:48
Whoops! You have to increase the partition first w/fdisk
. Resize2fs resizes the filesystem inside. I don't have time to write a complete answer right now, but the fdisk thing means "deleting" the partition then creating it again with the exact same starting block, but then a greater final size. It's pretty straightforward, but you may want to look for an intro to fdisk or something if you haven't used it before.
– goldilocks
Sep 23 '15 at 21:14
See
man resize2fs
.– goldilocks
Sep 23 '15 at 19:04
See
man resize2fs
.– goldilocks
Sep 23 '15 at 19:04
The sequence of steps is: 1. resize the partition, using any appropriate tool (
fdisk
, cfdisk
, gdisk
, &c.), and 2. resize the filesystem, using resize2fs
(most likely; there are different tools for different FSs). If you want, you can use gparted
to do it automatically.– Tom Hunt
Sep 23 '15 at 20:17
The sequence of steps is: 1. resize the partition, using any appropriate tool (
fdisk
, cfdisk
, gdisk
, &c.), and 2. resize the filesystem, using resize2fs
(most likely; there are different tools for different FSs). If you want, you can use gparted
to do it automatically.– Tom Hunt
Sep 23 '15 at 20:17
@goldilocks, I did use
resize2fs
but it says I am already at full block. When I run parted /dev/sdd/ print free
, I have a whole chunk of Free Space. I want to allocate that to my parition– Kousha
Sep 23 '15 at 20:48
@goldilocks, I did use
resize2fs
but it says I am already at full block. When I run parted /dev/sdd/ print free
, I have a whole chunk of Free Space. I want to allocate that to my parition– Kousha
Sep 23 '15 at 20:48
Whoops! You have to increase the partition first w/
fdisk
. Resize2fs resizes the filesystem inside. I don't have time to write a complete answer right now, but the fdisk thing means "deleting" the partition then creating it again with the exact same starting block, but then a greater final size. It's pretty straightforward, but you may want to look for an intro to fdisk or something if you haven't used it before.– goldilocks
Sep 23 '15 at 21:14
Whoops! You have to increase the partition first w/
fdisk
. Resize2fs resizes the filesystem inside. I don't have time to write a complete answer right now, but the fdisk thing means "deleting" the partition then creating it again with the exact same starting block, but then a greater final size. It's pretty straightforward, but you may want to look for an intro to fdisk or something if you haven't used it before.– goldilocks
Sep 23 '15 at 21:14
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Ended up using the following. Assuming the disk I want to expand is /dev/sdd
and has two partitions /dev/sdd1
and /dev/sdd2
, and I want to increase /dev/sdd2
.
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 -- -1
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
In this example, I wanted to increase to the maximum volume (hence -- -1
as argument of resizepart
. If you want to resize to a specific size, I suggest you first run
sudo parted /dev/sdd unit s print free
This should print something similar to
Number Start End Size Type File system Flags
63s 2047s 1985s Free Space
1 2048s 32767s 30720s primary fat16 boot, lba
2 32768s 5119999s 5087232s primary ext2
5120000s 15728639s 10608640s Free Space
Say you want to expand to sector 10120000s
(that's somewhere between the start/end of my free space 5120000s
to 15728639s
. In that case you run
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 10120000s
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
Hope this helps out somebody else as well.
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
accepted
Ended up using the following. Assuming the disk I want to expand is /dev/sdd
and has two partitions /dev/sdd1
and /dev/sdd2
, and I want to increase /dev/sdd2
.
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 -- -1
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
In this example, I wanted to increase to the maximum volume (hence -- -1
as argument of resizepart
. If you want to resize to a specific size, I suggest you first run
sudo parted /dev/sdd unit s print free
This should print something similar to
Number Start End Size Type File system Flags
63s 2047s 1985s Free Space
1 2048s 32767s 30720s primary fat16 boot, lba
2 32768s 5119999s 5087232s primary ext2
5120000s 15728639s 10608640s Free Space
Say you want to expand to sector 10120000s
(that's somewhere between the start/end of my free space 5120000s
to 15728639s
. In that case you run
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 10120000s
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
Hope this helps out somebody else as well.
add a comment |
up vote
1
down vote
accepted
Ended up using the following. Assuming the disk I want to expand is /dev/sdd
and has two partitions /dev/sdd1
and /dev/sdd2
, and I want to increase /dev/sdd2
.
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 -- -1
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
In this example, I wanted to increase to the maximum volume (hence -- -1
as argument of resizepart
. If you want to resize to a specific size, I suggest you first run
sudo parted /dev/sdd unit s print free
This should print something similar to
Number Start End Size Type File system Flags
63s 2047s 1985s Free Space
1 2048s 32767s 30720s primary fat16 boot, lba
2 32768s 5119999s 5087232s primary ext2
5120000s 15728639s 10608640s Free Space
Say you want to expand to sector 10120000s
(that's somewhere between the start/end of my free space 5120000s
to 15728639s
. In that case you run
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 10120000s
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
Hope this helps out somebody else as well.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Ended up using the following. Assuming the disk I want to expand is /dev/sdd
and has two partitions /dev/sdd1
and /dev/sdd2
, and I want to increase /dev/sdd2
.
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 -- -1
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
In this example, I wanted to increase to the maximum volume (hence -- -1
as argument of resizepart
. If you want to resize to a specific size, I suggest you first run
sudo parted /dev/sdd unit s print free
This should print something similar to
Number Start End Size Type File system Flags
63s 2047s 1985s Free Space
1 2048s 32767s 30720s primary fat16 boot, lba
2 32768s 5119999s 5087232s primary ext2
5120000s 15728639s 10608640s Free Space
Say you want to expand to sector 10120000s
(that's somewhere between the start/end of my free space 5120000s
to 15728639s
. In that case you run
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 10120000s
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
Hope this helps out somebody else as well.
Ended up using the following. Assuming the disk I want to expand is /dev/sdd
and has two partitions /dev/sdd1
and /dev/sdd2
, and I want to increase /dev/sdd2
.
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 -- -1
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
In this example, I wanted to increase to the maximum volume (hence -- -1
as argument of resizepart
. If you want to resize to a specific size, I suggest you first run
sudo parted /dev/sdd unit s print free
This should print something similar to
Number Start End Size Type File system Flags
63s 2047s 1985s Free Space
1 2048s 32767s 30720s primary fat16 boot, lba
2 32768s 5119999s 5087232s primary ext2
5120000s 15728639s 10608640s Free Space
Say you want to expand to sector 10120000s
(that's somewhere between the start/end of my free space 5120000s
to 15728639s
. In that case you run
umount /dev/sdd2
sudo parted /dev/sdd resizepart 2 10120000s
sudo e2fsck -f /dev/sdd2
sudo resize2fs /dev/sdd2
Hope this helps out somebody else as well.
edited Nov 23 at 21:28
Community♦
1
1
answered Sep 23 '15 at 21:21
Kousha
285316
285316
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f231643%2fincreasing-partition-of-a-sd-card%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
See
man resize2fs
.– goldilocks
Sep 23 '15 at 19:04
The sequence of steps is: 1. resize the partition, using any appropriate tool (
fdisk
,cfdisk
,gdisk
, &c.), and 2. resize the filesystem, usingresize2fs
(most likely; there are different tools for different FSs). If you want, you can usegparted
to do it automatically.– Tom Hunt
Sep 23 '15 at 20:17
@goldilocks, I did use
resize2fs
but it says I am already at full block. When I runparted /dev/sdd/ print free
, I have a whole chunk of Free Space. I want to allocate that to my parition– Kousha
Sep 23 '15 at 20:48
Whoops! You have to increase the partition first w/
fdisk
. Resize2fs resizes the filesystem inside. I don't have time to write a complete answer right now, but the fdisk thing means "deleting" the partition then creating it again with the exact same starting block, but then a greater final size. It's pretty straightforward, but you may want to look for an intro to fdisk or something if you haven't used it before.– goldilocks
Sep 23 '15 at 21:14