Case sensitive file format on SD card or external drive

70 views
Skip to first unread message

Theron Lewis

unread,
Oct 13, 2022, 11:15:41 PM10/13/22
to ChromiumOS Discussion
I just bought an octacore arm64 based chromebook with 8GB of RAM and 128GB storage (Acer Spin 513 H2) to use as a light travel dev machine.  I am on the stable version of the OS (Version 106.0.5249.112).  I enabled the linux dev environment and managed to get IntelliJ working and now I'm trying to build Android Studio and get the Android Emulator working on it.  The problem I'm having is drive space.  The repo is huge and that's without building anything.   I'd like to mount a 128GB SD card and have a card for each large project but the filesystem needs to be case sensitive and it looks like google dropped support for the EXT2/EXT3/EXT4 filesystems.  The only format options I get from the chrome os format menu are fat32, exFAT, and NFTS, none of which are case sensitive.  Some of my git repositories have distinct files with the same name but that are different by case so these repos won't work without some hacking and I believe Android Studio requires a case sensitive filesystem to build it on.

How do I format the SD card (or for that matter an external drive) and have it usable by the OS so I can mount it in the Linux environment?  I'd prefer the SD card since the machine has an SD card reader and I'd rather not have a hard drive dangling from my laptop when I'm trying to work on an airline tray table.

Thanks!

Theron Lewis

unread,
Oct 14, 2022, 11:19:38 PM10/14/22
to ChromiumOS Discussion, Theron Lewis
So I got the idea to create a 50GB filesystem image,  mount it on a loopback device, and format it using the same filesystem Linux was using.  I ran "dd if=/dev/zero of=/mnt/chromeos/removable/scratchMonk/loopbackfile.img bs=100MB count=500" and it took several hours to create the first 6GB on that file.  It was still increasing in size, but very slowly.  (I think /dev/zero was running low on zeros :-D). I removed the 128GB SD card and put it in my old macbook pro which has a card reader and ran the same thing (slightly modified since dd on the mac doesn't support the MB notation).  It finished in under 10 minutes.  I then put it back in the chromebook and ran "losetup -fP loopbackfile.img" and got back a message saying there were no free loopback devices.

Doing an image backup to the SD card on this machine also failed with the helpful message "Error while backing up Linux.  Backup couldn't be completed due to an error".  This is the same message I got when trying to back up the image to google drive.  I tried exiting all linux terminals and restarting the machine with the same result.  I've also done a hardware reset.  I am in the process of just backing up everything I was working on and the install of IntelliJ to a bzip2 compressed tarball and sending the laptop back to Amazon for an exchange since the right side USB-C port is hosed (I believe that is the technical term).  It doesn't recognize my display when plugged in to that side but has no problems when plugged in to the right side.  The I/O issues with the SD card could be a hardware issue or a bad implementation of the disk IO abstraction layer somewhere between the VM and the OS, but since this thing is having hardware issues I'm just going to send it back for another one.  If that one has hardware issues I'm going to get a refund and pick up a macbook air M2 with 16GB of RAM and a half TB of SSD storage and hope I can run chromium OS in a hypervisor.

My main goal was to have something fun to play with that I could use for everyday stuff and could also do some development on.  I wanted something small I could travel with, energy efficient, lightweight, and that I wouldn't be too upset if it got stolen.  I think Chrome OS is almost but not quite there yet.  I might try switching to the Beta or Canary track and see if it's any better.

Just to clarify, my first exposure to Chrome OS was two days ago when I got the machine.  I'd like to get familiar with it and possibly develop for it.  Any advice?

david....@gmail.com

unread,
Oct 15, 2022, 4:56:02 PM10/15/22
to ChromiumOS Discussion, the...@gmail.com
Since you have enabled the developer mode, you can easily format the SD card from the shell. CRTL+ALT+T and then type shell. That will give you access to many standard Linux utilities including fdisk and mkfs.ext4 
Although you won't be able to use the SD card from ChromeOS, you can share the disk with Linux from the Files app. Right Click on the SD card and "Share with Linux" In the Linux container the disk is mounted at /mnt/chromeos/removable/SDxxx   

david....@gmail.com

unread,
Oct 15, 2022, 4:59:14 PM10/15/22
to ChromiumOS Discussion, david....@gmail.com, the...@gmail.com
Partitioning and formatting a 32 GB SD card only took a few seconds. 

Theron Lewis

unread,
Oct 15, 2022, 11:02:10 PM10/15/22
to david....@gmail.com, ChromiumOS Discussion
Thanks!  I was contemplating writing a fuse filesystem in c++ to mount a directory in the case insensitive filesystem as case sensitive and store all the files with name collisions using a specially formatted random base64  suffix that would be filtered out, but this sounds like a better idea.

I returned the Chromebook because of a bad USB-C port on the right hand side of the laptop and Amazon ran out of them but I'm ordering a replacement from Best Buy.

I might write that fuse filesystem anyway.  It should be a fun project.

John S

unread,
Oct 17, 2022, 10:49:40 PM10/17/22
to ChromiumOS Discussion, the...@gmail.com, ChromiumOS Discussion, david....@gmail.com
Since I am on a similar situation, with your permission I am going to continue this conversation a bit.

I also just bought a Chromebook and also trying to use it for coding. So far very nice, but I have run into the same issue of lack of disk space when trying to work with large codebase and with sporadic use of large docker images.
So I also bought an SD card with the intention of solving this problem.
In my case I have not enabled developer mode, but might do it if you guys suggest it or if it solves this issue.

I have gotten to the point of creating a new disk image in the SD card, with the command:

vmc create-extra-disk --size=100G --removable-media "sdcard/disk.img"

And launching the VM with this extra disk:

vmc start termina --extra-disk /media/removable/sdcard/disk.img

This successfully makes the disk image available to the Linux container. I can see it in the "mount" command output and in the "df" command output.
The problem is that I have to run this last command (vmc start...etc.) every time I want to use the Linux subsystem, which is not very convinient.
How to fix this?  Is this the proper way to do it?

Thank you for your time

Theron Lewis

unread,
Oct 18, 2022, 3:36:17 AM10/18/22
to John S, ChromiumOS Discussion, david....@gmail.com
That is really cool.  I'll have to play with that when my replacement Chromebook arrives.

François Degros

unread,
Oct 19, 2022, 12:42:50 AM10/19/22
to the...@gmail.com, ChromiumOS Discussion
Hi Theron

I'd like to mount a 128GB SD card and have a card for each large project but the filesystem needs to be case sensitive and it looks like google dropped support for the EXT2/EXT3/EXT4 filesystems.  The only format options I get from the chrome os format menu are fat32, exFAT, and NFTS, none of which are case sensitive.

Indeed, Files App only offers to format external media as FAT32, exFAT or NTFS.

But ChromeOS is able to mount an ext2, ext3 or ext4 partition and share it with the Linux environment.

I just tried that, and I confirm that case-sensitive filenames are supported. See:
canvas.png

How do I format the SD card (or for that matter an external drive) and have it usable by the OS so I can mount it in the Linux environment? 

You might need to create and format this ext* filesystem using another computer. For example, I used gparted on a Linux workstation. Once it is created, this filesystem should appear in Files App when you plug your USB drive into your Chromebook.

Cheers

Theron Lewis

unread,
Oct 19, 2022, 11:59:51 AM10/19/22
to François Degros, ChromiumOS Discussion
That is awesome!  My replacement Chromebook should arrive today or tomorrow.  I'll give that a try!  In the meantime I'll format a couple of my SD cards as ext3.


François Degros

unread,
Oct 24, 2022, 2:16:30 AM10/24/22
to Theron Lewis, ChromiumOS Discussion
Great. Tell us if it's working for you.

Theron Lewis

unread,
Oct 26, 2022, 7:46:38 PM10/26/22
to François Degros, ChromiumOS Discussion
Unfortunately it didn't work.  I tried ext2, ext3, and ext4 format SD card both using the built in micro SD card reader and using a USB stick adapter and it appears to be read only.  I can share it to my Linux VM but linux says I can't write to the filesystem even as root and when I use the ChromeOS file utility to try to create a folder I get the following error: 

Unable to create new folder. The filesystem or device is unusable.

It does show the lost and found directory and any files on the filesystem.

I will try to enable Linux control of the USB device and see if I can access it exclusively.

Theron Lewis

unread,
Oct 26, 2022, 8:20:39 PM10/26/22
to François Degros, ChromiumOS Discussion
Making the mass storage device available to Linux didn't work either.  It looks like my only choice is to write a fuse filesystem to mount a subdirectory on one of the supported file systems as case sensitive by doing name munging on the files when there is a name collision.

François Degros

unread,
Oct 31, 2022, 6:21:51 PM10/31/22
to Theron Lewis, ChromiumOS Discussion
We solved the issue. Here is the solution for everyone to read...

The SD card is correctly mounted in writable mode. All good here.

The problem is a Unix permission issue on the root folder of the ext* filesystem. 

In order to fix this issue, you need a Linux computer (like the one you used to create the ext* filesystem in the first place).

Plug your SD card in the Linux computer and mount the ext* filesystem. Go into the mounted directory, and make it writable for everyone. 

Example:

$ cd /media/banana

$ findmnt .
TARGET        SOURCE    FSTYPE OPTIONS
/media/banana /dev/sda3 ext4   rw,nosuid,nodev,relatime,errors=remount-ro

$ ls -ld
drwxr-xr-x 3 root root 4096 Oct 28 14:33 .

$ sudo chmod a+w .

$ ls -ld
drwxrwxrwx 3 root root 4096 Oct 28 14:33 .


Unmount the SD card. Plug it into the Chromebook. It should now work and be writable.

Cheers
Reply all
Reply to author
Forward
0 new messages