adammw
Posts: 21
Joined: Fri Jun 15, 2012 4:28 am

Single FAT SD card partition with loop file for root device?

Fri Jun 15, 2012 11:43 am

Ubuntu has been able through Wubi to install itself onto a NTFS drive by creating a loop file in the filesystem that contains the ext4 filesystem, could a similar thing be done with the Debian-based raspberry pi kernel? This would have the added benefit of a simple drag-and-drop experience for creating SD cards.

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Single FAT SD card partition with loop file for root dev

Sun Jun 17, 2012 6:08 pm

Sounds like something that should work. Currently I'm searching the forum for initrd support which I'm currently 50/50 on if that works with the Pi.

So what you'd need to do is verify/build a kernel with loop support as well as the fs of your choice for your iso. The next step is to modify your initrd boot sequence to mount the iso as a loop device and then set the root device appropriately. I'd say its probably a slightly more advanced task to perform but nothing super difficult. Just a lot of trial and error.

Now one thing to note is that you'll have to do a little magic for making the iso r/w to allow for system updates. You'll also need to mount your /home to some other storage, an SD partition or some image file.

Links to forum discussion on initrd:
http://www.raspberrypi.org/phpBB3/viewt ... trd#p97835
http://www.raspberrypi.org/phpBB3/viewt ... 513#p41513
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

lb
Posts: 263
Joined: Sat Jan 28, 2012 8:07 pm

Re: Single FAT SD card partition with loop file for root dev

Mon Jun 18, 2012 8:12 am

Well, there's only one issue with this: FAT32 only supports files up to 4 GB size.

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Single FAT SD card partition with loop file for root dev

Mon Jun 18, 2012 1:33 pm

lb wrote:Well, there's only one issue with this: FAT32 only supports files up to 4 GB size.
Anyone know how Wubi handles this?
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

lb
Posts: 263
Joined: Sat Jan 28, 2012 8:07 pm

Re: Single FAT SD card partition with loop file for root dev

Mon Jun 18, 2012 1:39 pm

AFAIK it doesn't. You need an NTFS partition.

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Single FAT SD card partition with loop file for root dev

Mon Jun 18, 2012 3:23 pm

Oh yeah, sorry wasn't processing it all in my head. There is an NTFS driver in the Kernel. Never tried it with ARM before. If it works then you should be able to setup a Wubi-like distro. So I guess you could make two partitions on the SD card: one FAT32 and one NTFS. Boot goes in one and RFS in another.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

lb
Posts: 263
Joined: Sat Jan 28, 2012 8:07 pm

Re: Single FAT SD card partition with loop file for root dev

Mon Jun 18, 2012 10:35 pm

Well, maybe 4 GB are enough for some uses, or a split between / and /home is alright, with 4 GB for each filesystem.

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Single FAT SD card partition with loop file for root dev

Mon Jun 18, 2012 11:32 pm

lb wrote:Well, maybe 4 GB are enough for some uses, or a split between / and /home is alright, with 4 GB for each filesystem.
I'm working on the logistics of the problem and going to make a tutorial blog post hopefully tonight. I'm thinking separate / and /home files. And the /home file could be replaced with a fat32 filesystem right on the SD card. More to come.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Single FAT SD card partition with loop file for root dev

Tue Jun 19, 2012 3:03 am

So which would be more useful...writing this post for Debian, Arch, Raspian, simple little busy box distro? The reason I ask is because the initramfs file build structure is different so I'd probably approach the task differently depending on the most useful choice.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

asr82
Posts: 1
Joined: Wed Nov 07, 2012 6:33 pm

Re: Single FAT SD card partition with loop file for root dev

Wed Nov 07, 2012 6:35 pm

jecxjo any luck figuring this out? I would be interested in a tutorial geared towards Debian.

Thanks.

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: Single FAT SD card partition with loop file for root dev

Thu Nov 08, 2012 10:01 pm

Sorry fell to the bottom of my list of ToDo's. I'll take a look into it and see what I can come up with.
xmpp: jecxjo@dukgo.com
Blog: http://jecxjo.motd.org/code

Return to “Debian”