• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Moving partially onto the SD from flash?  (Read 1277 times)
elsalvador
Newbie
*

Karma: 0
Posts: 5


View Profile
« on: October 07, 2010, 03:39:06 AM »

Hi Guys,

Wonder if anyone can give me a shove in the right direction?
I have a Guruplug, noisy but nice.
I don't have the JTAG, so I think my options about file locations OS boot etc are pretty limited.
It came with Debian 5, which is fair enough, I don't need bleeding edge (er.. do I?)
It's using 50% of the flash currently, but I don't think all these apps are going to fit in the other half.

I have an 8G SD card locked & loaded, but how can I shift stuff over there?
I'm guessing I'd probably like to shift /var and maybe /usr using symlinks, but aren't there files in use in these directories which stop me doing that?
(on my old box /var is 788Meg, and /usr is 553meg)
I'm really open to suggestions here.
One suggestion I got from a chum was to get all the apps as source, and compile them with my own choice of target directories, but that scares the willies out of me, so it's unlikely to happen that way...

Clearly I'm cautious of any process which is going to brick the thing, but if the only way is to get a JTAG, then so be it.
Thanks in advance - any suggestions welcome.
all the best
elsalvador
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #1 on: October 07, 2010, 07:19:08 AM »

What you have in mind require change of system structure which is difficult even with console access it would be almost impossible without console access. so I suggest you get a JTAG so even your brick it you can recover.

My personal favor would be using a patched kernel with "aufs" or "unionfs" than you can overlay your SD content with flash. Once you get it done your are safe for life of the plug and it become so much easy to recover should something gone wrong.


Good luck  Smiley
Logged

Good Luck Smiley

theYinYeti
Newbie
*

Karma: 0
Posts: 15


View Profile WWW
« Reply #2 on: October 07, 2010, 08:06:15 AM »

Here is something I did involving LVM, that may give you ideas on how to proceed:
http://mandrivausers.org/index.php?/topic/83474-remotely-grow-and-shrink-lvm-partitions-mandriva

The problem you have with moving /var seems similar to the problem I had moving /usr under LVM. In short (if you’re not interested in reading the above link), the steps are:
 — copy the data to the new location,
 — change fstab so that the new device node is mounted instead of the old one,
 — lazy-umount the old location and quickly mount the new one (mount -a), then reboot.

I wrote this on-the-fly and did not test. Make sure you understand and feel confident before trying this.

Yves.
Logged

elsalvador
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #3 on: October 07, 2010, 06:18:39 PM »

...so I gave it a go...just moving /var, which seemed to work at first...mysql started ok (whoopee!)
Didn't survive a reboot though, so NBG
Sadly it's now bricked, so I'm awaiting the JTAG board because the clever designers forgot a serial port, on a UNIX server!!

On a scale of 1 to pi**ed off, i'm definitely at the top of the scale there....grr
grr
grr

Just buy the Sheeva version, at least you don't need extra cost items just to get a serial port. grr
Logged

elsalvador
Newbie
*

Karma: 0
Posts: 5


View Profile
« Reply #4 on: October 09, 2010, 02:38:08 PM »

Well - what a turnup for the books!

I think the plug is flaky. The story so far:
2 days ago I made some changes, got them wrong & backed out, putting the original  /var back again, and sent it off for a reboot & it didn't come back up. I assumed it was bricked. "Time to order the JTAG" I growled.

Just in case, I power cycled it the yesterday morning (it's in the garage on account of being so noisy), and still nowt.

While I was in the garage today, I figured I'd bring it in & as I had a spare moment, figured I'd give it one more chance...and it booted - as if nothing had been wrong!
I've tried it a few times now & "reboot (aka shutdown -r) doesn't reliably work.
Powering it down certainly seems to...most of the time...but not always.

Oh sheesh - I think it's not a happy camper.

Anyway - as the JTAG is on its way (Postoffice won't deliver on Saturdays, despite extra carriage charge), I figured I might as well have a go at the process & see....nothing to lose at this stage...

This is same process as used to "add disk space to ESVA" - you can look it up I'm sure.
Shut down all processes using /var (ok can't get rid of all, but worth a try!)
Make 2 partitions on the SD, format them both as ext3, and mount in temp locations (/store/sd1 etc)
Copy contents of /var to /store/sd1, with ownership etc (& check it all went)
mv /var /var_old
change /etc/fstab so sd1 mounts as /var & create the mount point
umount /dev/sdb1
mount -a
et voila! /var seems to contain the stuff it's supposed to....(appears to!!)

Did the same for /usr  and that seemed to work too...
Shutdown & power off, cross fingers & wait patiently for the dozen or so lost pings & it worked!!
mysql was still running, eth0 works fine, web server, what else can I test?!

So send the bu**er back because it's unreliable? Maybe - try a few more things & see...
Enjoy.
Logged

Pages: [1]
Print
Jump to: