Ask / Submit
5

btrfs device scan

asked 2014-02-09 21:27:45 +0200

dies_felices gravatar image

updated 2014-02-09 21:28:38 +0200

This question pertains specifically to adding a btrfs formatted SD card to your rootfs.

For this to work safely, #btrfs state that 'btrfs device scan' must be run before the rootfs is mounted.

Does this happen?

How can it be configured to happen?

This is system developer sort of question not a feature request.


To make your SD card btrfs.

Identify the device in /dev probably mmcblk1.p1

Once you are certain of your target and happy that you've backed up all important data then run:

devel-su

mkfs.btrsf -f /dev/target-SDCard.partition-label

I got a couple of warnings explaining that the current version of btrfs is not yet stabe and a link to the btrfs wiki. Then it showed me a report.


What will this do for the user. Basically, it will integrate your SD card into your phone, so where as the Jolla without SD card has 16 GB of storage. With the SD card (32 GB for example) you will get 48 GB contiguous storage.

Otherwise you're getting the 16 GB plus the 32 GB mounted at /run/user/100000/media/sdcard and then you can find your files. Here assuming the card is in a readable format (vfat, ntfs, ext4).

edit retag flag offensive close delete

Comments

Just to add an update. As a part of my due diligence I've been researching this issue. It appears though it has not been confirmed that the command 'btrfs device scan' is run prior to the mounting of the file system.

The important thing which I have learned thus far is that the risk of 'bricking' your phone as a result of adding the SD card to the file system is unacceptably high. Such that I am not willing to take the risk on my own phone with out a backup plan. The backup plan has become my new focus for the time being.

In addition, there is also the consideration of not adding the SD card to the root file system rather adding it to /home or maybe in other configurations. This too needs investigating. Overall my goal remains the same but I am adapting my strategy to suit new information.

dies_felices ( 2014-02-12 00:58:34 +0200 )edit

At this point in time I can only offer a disheartening update. My strongest recommendation is this do not format your SD cards btrfs at this time. Over this last week I experienced increasing instability to the extent that my Jolla became unusable on Saturday evening. The only positive being that when removed my SD card and rebooted everything was back to normal.

dies_felices ( 2014-02-24 21:34:07 +0200 )edit

I was going to ASK this very same question

Does anyone know if the device scan is run before mounting root volume to allow adding SD card to rootfs? I intend take a block level snapshot of current rootfs for restoration/backup then add the sccard to the btrfs volume.

My Jolla is also my daily so not willing to be the first to try. maybe second if it's successfull

GD ( 2015-06-12 09:12:27 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2014-06-12 13:05:52 +0200

dies_felices gravatar image

Apologies for taking so long to return to this.

After a lot of investigation, I have discovered that my original suggestion is not possible as btrfs does not support that kind of functionality, nor to they intend to.

Onward, to resolve the issue. My new suggestion is to create a dedicated User's Data file-system and then when an SD card is detected offer the user the choice of formatting the card btrfs with the additional span option.

Before formatting the usual predicates would apply:

  • Is there already data on the card? (If so warn that data may be lost)
  • Is the SD card already formatted btrfs? (offer options to span without formatting)
  • Is the SD card in an unreadable format? (If so warn that data may be lost)
  • Advise of other popular use case scenarios to allow the user to get the best out of their device.
  • Does the SD card have any diagnostic indicators of a fault?

I would recommend this for the Jolla Phone 2 as it is a an architectural change.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2014-02-09 21:27:45 +0200

Seen: 519 times

Last updated: Jun 12 '14