Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

A place to share useful EV3 partition & file system insights.

An EV3dev 32GB SDcard with multiple partitions with various file systems can be useful.

CHroot to fix things likely also can be useful...but so far for an SDcard still seems to require an actual machine running linux since WSL2 still does not mount SDcards: microsoft/WSL#8408 (comment)


Windows diskmgmt in combination with Debian fdisk & resize2fs:

After flashing EV3dev images to SDcard with Balena Etcher, in a number of cases the file system will expand to fill the whole SDcard during the first boot.

So on cards where I would like to limit the size of the EV3dev partitions, immediately after flashing the SD via etcher, I have used Windows disk management to create additional partitions on the SD.

If I want my main EV3dev partition to end up at about 8GB then usually create a 4GB place holder partition adjacent to the partition created by Etcher, then a bunch of other partitions of various sizes...some I use for swap, some to store files in NTFS and FAT32 file systems.

Then with fdisk from SSH terminal to the booted EV3dev, I can delete a place holder partition & expand the EV3dev main partition & file system...

https://serverfault.com/questions/994448/extend-linux-partition-size-without-losing-any-data-techniques

or change the filesystem of a partition to ext4, mount/unmount disk partitions, etc...

robot@ev3dev:~$ sudo fdisk -l
[sudo] password for robot:

Disk /dev/zram0: 96 MiB, 100663296 bytes, 24576 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk **/dev/mmcblk0**: 29.6 GiB, 31719424000 bytes, 61952000 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: dos
Disk identifier: 0x1733988d

Device         Boot    Start      End  Sectors  Size Id Type
/dev/mmcblk0p1          8192   106495    98304   48M  b W95 FAT32
/dev/mmcblk0p2        106496  7372799  7266304  3.5G 83 Linux
/dev/mmcblk0p3      15761408 61951999 46190592   22G  f W95 Ext'd (LBA)
/dev/mmcblk0p5      15763456 32540671 16777216    8G  c W95 FAT32 (LBA)
/dev/mmcblk0p6      32542720 34639871  2097152    1G  e W95 FAT16 (LBA)
/dev/mmcblk0p7      34641920 61951999 27310080   13G  c W95 FAT32 (LBA)

robot@ev3dev:~$ sudo fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): d
Partition number (1-3,5-7, default 7): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 1 extended, 2 free)
   l   logical (numbered from 5)
Select (default p): p
Partition number (2,4, default 2): 2
First sector (2048-61951999, default 2048): 106496
Last sector, +/-sectors or +/-size{K,M,G,T,P} (106496-15761407, default 15761407):

Created a new partition 2 of type 'Linux' and of size 7.5 GiB.
Partition #2 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: N

Command (m for help): w

The partition table has been altered.
Syncing disks.

robot@ev3dev:~$ sudo reboot

robot@ev3dev:~$ sudo resize2fs /dev/mmcblk0p2

resize2fs 1.44.5 (15-Dec-2018)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p2 is now 1956864 (4k) blocks long.

robot@ev3dev:~$ sudo reboot

robot@ev3dev: $ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             26M     0   26M   0% /dev
tmpfs            20M  332K   20M   2% /run
/dev/mmcblk0p2  7.4G  3.1G  3.9G  45% /
tmpfs            28M     0   28M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            28M     0   28M   0% /sys/fs/cgroup
/dev/mmcblk0p1   48M  230K   48M   1% /boot/flash
tmpfs           5.6M     0  5.6M   0% /run/user/1000
robot@ev3dev: $
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.