Author Topic: SD Card as internal storage  (Read 3470 times)

panyo

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • http://
SD Card as internal storage
« on: March 24, 2004, 09:01:51 pm »
There was a post with exactly the same subject line on the Sharp dev board that described a method for moving internal storage to the SD card. That worked very well for me.  I have it bookmarked as
http://www.zaurus.com/dev/board/index.php?...pic=4928&hl=vim

I cannot find it on the mirror here as I could not search and each forum seems to have only three or four pages of posts available.

I remember that the post said the SD card would have to remain installed and it suggested that to avoid confusion the \'install on card\' option should be removed from the package mannagment app. Also, /mnt/card/root/ apparently was my root home directory -ie all the invisible files were there, not at /root. However, I cannot remember the rest of the post.

As an alternative, I have tried starting with a blank ext2 SD card and following the instructions at
http://www.linux-migration.org/ch05s10s05s03.html
skipping the page on moving only non-essential /usr subidrectories and going to the page on moving the whole /usr directory.

When I try to install pacages, I get the following error and while files are installed, the packages do not appear to work.

Code: [Select]
file_move: ERROR: failed to rename /mnt/card/usr/lib/ipkg/status.tmp to /mnt/card/usr/lib/ipkg/status: No such file or directory

My goal is to use my 256M SD card and my 64/0 OZ 3.3.5 setup to maximize my ability to install and run progarms I normaly run on my laptop.  I was just about there before, but I broke my ability to install new ipks while unsuccessfuly trying to set up an on-board compile environment that could build my Dvorak modifications to IRK.

I see a couple of somewhat related threads, but it is not clear to me that they fully work or are appropriate to OZ as of now.  I hope someone can let me know how to solve this problem by showing me what I am doing wrong relative to the OZ site instructions, or if there is something left out on that site helping to fix it, or helping me retrieve the lost post on the Sharp site, or letting me know of a known working better method.
SL5500  OZ3.5.2 (Opie), Dvorak built in keyboard
Spectrum24 Ethernet
SanDisk 256 ext2 (AR0401RF China) SD
Lexar 256 VFAT (P/N 2260, Rev. A), Transcend 128 ext2 CF
Pismo, Cube, 8600, Gentoo PowerPC, YellowDog

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
SD Card as internal storage
« Reply #1 on: March 24, 2004, 11:29:28 pm »
This may not be exactly what your looking for, but check out my thread on dual boot setup.  I finally got around to putting together packages to support it, they are attached to the message towards the end of the first page.
What this does is it allows you to run a slightly modified sharp rom installed in your flash, which upon bootup, if it detects a specially prepared SD card it will start mount it up as root and continue from there.  You can have just about any distribution installed on that sd card, but the scripts I posted are geared for openzaurus 3.3.5.

What you basically do is install the sharp rom (or tkc rom if you prefer), install the package modrom-dualboot_arm.ipk, put in a big enough CF card and run the modrom-duallboot.sh script.  What you end up with is a new initrd.bin file (based on your currently installed rom) that you can flash.  Then you can run the script oz2sd.sh (in the oz2sd_arm.ipk), and it will extract openzaurus from it\'s initrd.bin file and deposite it (along with some fixes and support files) onto your SD card.  Then reboot with the SD inserted, and you are running OZ completely off the card.  You can later reboot without the card inserted, and be back to the default sharp rom.

panyo

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • http://
SD Card as internal storage
« Reply #2 on: March 25, 2004, 03:31:50 am »
Quote
This may not be exactly what your looking for, but check out my thread on dual boot setup.  I finally got around to putting together packages to support it, they are attached to the message towards the end of the first page.

Derekp, thank you for your detailed reply and your great work. I followed the insturctions in your post and got quite far. However, when I tried to reboot after the step that sets up the SD card, I got the error
Code: [Select]
/lib/ld-linux.so.2: version \'GLIBC_2.2.3\' not found (required by /mnt/card/lib/libc.so.6)

I reset by toggling the switch on the batery cover ( on my SL5500) and on reboot stopped at this error
Code: [Select]
/dev/init.card: permission denied
edit  (also when I reflashed to OZ, I found init.card was empty. Now trying to use - bind in /etc/fstab after a post by khim but my SD card is not mounting at this time of night with  root,opt,usr, and home moved. )

I popped out the SD card and booted. I put the card back in and when I tried to use ls to look at the card, I got the GLIBC error again.

I used your async kernel and the 1.0 TKCrom.

Since my primary interest is in running OZ (I have a Symbol WF and connect to a Gentoo Powerbook by USB, thus get the impression OZ is what I need) and  in having enough resources to install and run, possibly larger than reasonable, applications I was curious to see what the non-OZ side of the dual boot would make unavailable in terms of memory and flash, that is if it would noticably restrict  what I could install and run compared to the OZ 64/0 configuration.
SL5500  OZ3.5.2 (Opie), Dvorak built in keyboard
Spectrum24 Ethernet
SanDisk 256 ext2 (AR0401RF China) SD
Lexar 256 VFAT (P/N 2260, Rev. A), Transcend 128 ext2 CF
Pismo, Cube, 8600, Gentoo PowerPC, YellowDog

braindrop

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://
SD Card as internal storage
« Reply #3 on: March 25, 2004, 08:50:59 am »
the other thread here \'moving to sd again\' worked relly well for me with the 3.3.5

derekp

  • Full Member
  • ***
  • Posts: 154
    • View Profile
SD Card as internal storage
« Reply #4 on: March 25, 2004, 11:47:48 am »
Quote
Code: [Select]
/lib/ld-linux.so.2: version \'GLIBC_2.2.3\' not found (required by /mnt/card/lib/libc.so.6)

I found out that the cause of this is tkcrom sets LD_LIBRARY_PATH to include /mnt/card/lib.  Therefore, once oz2sd.sh finishes writing out the oz tree to the sd, then any command afterwards will be picking up the wrong shared libraries.  The simple solution to this is to enter:
  unset LD_LIBRARY_PATH
before executing oz2sd.sh.  This is also why the script failed to create things such as /mnt/card/init.card, the \'cat\' command probably failed after the file extraction.

Also, I found that sometimes when runing tkcrom, when you insert the sd card with oz already extracted to it, then umount will fail with \"device busy\".  Solution to this (if you want to re-run the oz2sd.sh script) is to kill the sdmgr process before inserting the sd card.

Did everything go ok with the modrom-dualboot step?  This is the part I was most concerned with, since it is updating the system rom.

panyo

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • http://
SD Card as internal storage
« Reply #5 on: March 25, 2004, 12:31:14 pm »
Quote
Did everything go ok with the modrom-dualboot step?  This is the part I was most concerned with, since it is updating the system rom.

That part seemed to work with no problems (though I did not test much),  quite nice.  I will try again later today following the rest of what you said.

Braindrop, the post by khim I was reffering to was in that thread right before your posts.
Not partitioning the card seemed a little more flexible, so I tried khim\'s way, but I clearly made a mistake. I\'ll try again later today, and will have a look at the scripts in that thread too.  
SL5500  OZ3.5.2 (Opie), Dvorak built in keyboard
Spectrum24 Ethernet
SanDisk 256 ext2 (AR0401RF China) SD
Lexar 256 VFAT (P/N 2260, Rev. A), Transcend 128 ext2 CF
Pismo, Cube, 8600, Gentoo PowerPC, YellowDog

panyo

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
    • http://
SD Card as internal storage
« Reply #6 on: March 25, 2004, 07:21:24 pm »
Quote
I found out that the cause of this is tkcrom sets LD_LIBRARY_PATH to include /mnt/card/lib.  Therefore, once oz2sd.sh finishes writing out the oz tree to the sd, then any command afterwards will be picking up the wrong shared libraries.  The simple solution to this is to enter:
  unset LD_LIBRARY_PATH
before executing oz2sd.sh.
Ok, I have had a closer look at that thread and see you already addressed this problem there. Sorry for the bad question and thank you for your patience. That fixed the instalation for me.
These are the memory usage numbers in k I got
Code: [Select]
OZ/dual  TCKrom  OZ/64/0

10757     9848      10175  used

2178       5115      147      buffers

14446     12881    12566  cached

1392       815        41132  free

28659      -            63893  total


I am still trying to figure out how to use bind to mount directories that apparently worked for a guest in the above mentioned thread.
adding
Code: [Select]
/mnt/card/opt /opt - bind 0 0
to /etc/fstab, with an empty dirctory at /opt to mount the real opt from the SD card did not work. The SD card mounts, but not the bind line.
SL5500  OZ3.5.2 (Opie), Dvorak built in keyboard
Spectrum24 Ethernet
SanDisk 256 ext2 (AR0401RF China) SD
Lexar 256 VFAT (P/N 2260, Rev. A), Transcend 128 ext2 CF
Pismo, Cube, 8600, Gentoo PowerPC, YellowDog