About

Archives

01 Jul - 31 Jul 2006
01 Aug - 31 Aug 2006
01 Sep - 30 Sep 2006
01 Oct - 31 Oct 2006
01 Nov - 30 Nov 2006
01 Dec - 31 Dec 2006
01 Jan - 31 Jan 2007
01 Feb - 28 Feb 2007
01 Mar - 31 Mar 2007
01 Apr - 30 Apr 2007
01 May - 31 May 2007
01 Jun - 30 Jun 2007
01 Jul - 31 Jul 2007
01 Aug - 31 Aug 2007
01 Oct - 31 Oct 2007
01 Nov - 30 Nov 2007
01 Dec - 31 Dec 2007
01 Jan - 31 Jan 2008
01 Feb - 28 Feb 2008
01 Mar - 31 Mar 2008
01 Aug - 31 Aug 2009
01 Sep - 30 Sep 2009
01 Jan - 31 Jan 2010
01 May - 31 May 2010
01 Jun - 30 Jun 2010
01 Aug - 31 Aug 2010
01 Sep - 30 Sep 2010

Links

Search!

Last Comments

Alvaro Oliver (StackBook Part 4 …): Hey! nice post. I just bo…
Tiago Gomes (Let's start again…): ok, now feel happy, you a…
Tiago Gomes (Let's start again…): ok, now feel happy, you a…
ir0nhide (StackBook Part 4.…): Very cool, nice work
Toby (Gigabyte, LCDs, a…): Good stuff, although now …
luke (StackBook part 3 …): what are you planing to u…
Toby (A quick rant...): Bastards
Hugh (StackBook Part 2 …): Nicely done, but you now …
gm (StackBook Part 2 …): Hmm, I plan to go a littl…
luke (StackBook Part 2 …): i cant help but wonder if…

Stuff

Powered by Pivot - 1.40.4: 'Dreadwind' 
XML: RSS Feed 
XML: Atom Feed 

« Damn bots.. | Home | Python on Linux on Pa… »

Moving home to a bigger rootfs...

20 08 06 - 11:59 The default rootfs you'll find in that previous link is a little small for actually doing stuff with. We'll obviously need a bigger one if we actually plan to do something interesting.

I'm going to create a 230MB rootfs (to put on a 256 SD card, but it actually ended up going on my 1GB card...). You can create any size you want I guess, limited only by SD card.

You could of course partition your SD card, but I may want to use my SD in various devices, and don't want, say, a digital camera messing up the ext2 partition because it doesn't know what it is. So I use a rootfs file on the SD card.

First of all, we need to create the blank file to make the rootfs onto. Make it the size you want. You will need a linux machine and a SD reader. I met some trouble here as my Linux laptop is on the other side of town and I removed the Linux partition off my main laptop (needed the 10GB for something else). So, I picked a PowerPC Ubuntu CD up off the stack on my desk (my order came in a few days ago), and threw it into the G4's CD drive. I booted up to the live environment and did all this.

Maybe it could be done on the Palm. Theoretically it is possible, and it might work, but I haven't tried, nor do I want to.

dd if=/dev/zero of=linux_root.ext2 bs=1M count=230

bs is the block size - not of the filesystem we are about to make - but of the dd copy. We make a 1MB block from /dev/zero, and do so 230 times - 230x1MB is 230MB. You can replace the 230 with the size you want the filesystem.

Now run
mke2fs linux_root.ext2
or
mkfs.ext2 linux_root.ext2
depending on your distro. Most distros I've seen have the first, but Gentoo has the second.

Now, we need to loopmount the filesystems, so we can do our thing. We will mount them both at /mnt/im1 and /mnt/im2, tar up the contents of one, and untar it to the other. Why not just cp them? cp messes up static linked files, by copying the original file instead of the symlink.

cd to wherever the card is mounted (in /mnt or /media), and run the following commands at a root shell (sudo su if you have sudo, or su if you have a root password, or use "root terminal" or whatever is necessary to see a # prompt).


mkdir /mnt/im1
mkdir /mnt/im2
mount -o loop opie-image-v0.8.4-rc3-palmtx.rootfs.ext2 /mnt/im1
mount -o loop linux_root.ext2 /mnt/im2
cd /mnt/im1
tar -cvf /opie.tar .
cd /mnt/im2
tar -xvf /opie.tar .
rm /opie.tar
cd /
umount /mnt/im1
umount /mnt/im2


(yeah, there's probably a better way to manage those tar commands. maybe
tar -cv /mnt/im1 | tar -xv /mnt/im2 will work, but i haven't tried)

Remove the old opie image, and edit linux.boot.cfg to change ROOT_DEV to /media/mmc1/linux_root.ext2.

Now, unmount and eject the SD from the card reader, and put it into the Palm. Boot into Linux and enjoy your less spacious SD card, and more spacious Linux root device.

Coming soon: How to actually install stuff onto the bigger rootfs.
No comments

Trackback link: http://gm.stackunderflow.com/blog/pivot/tb.php?tb_id=30

  
Remember personal info?

Emoticons / Textile

To prevent automated comment spam, the answer to this rather simple question is required...

 

  (Register your username / Log in)

Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.

 

Linkdump