Setting path to an External USB flash drive

Hello All;

I have been going thru uSD cards because I am using Cloud9 as a local IDE.

The number of writes performed by Cloud9 seems to be trashing the uSD card.

So I thought I would re-install Cloud9 on an External flash drive.

I modified /ext/fstab so that the drive is automatically mounted:

proc /proc proc defaults 0 0

/dev/mmcblk0p2 / auto errors=remount-ro 0 1

/dev/mmcblk0p1 /boot/uboot auto defaults 0 0

/dev/sda1 /media/disk1 vfat auto,umask=0 0 0 <-----------

So now if I go to /media I see:

root@ubuntu-armhf:/media# ls -l

total 28

drwx------ 10 ubuntu ubuntu 16384 Jan 1 1970 BOOT

drwxrwxrwx 3 root root 8192 Jan 1 1970 disk1

drwxr-xr-x 3 root root 4096 Feb 10 17:38 rootfs

What I need to know is, to access “/dev/sda1/media/disk1” do I just add this to $PATH:

PATH=$PATH:/media/disk1

Thanks;

Bill

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

HI William, why not put the whole rootfs on an external USB drive ?

http://www.embeddedhobbyist.com/debian-tips/beaglebone-black/beaglebone-black-usb-boot/

If anything is unclear feel free to ask here, as I’ve derided long time ago to disable comments on my blog site.

Oh, and for what its worth, the working example I setup on that blog post, had a swap disk enabled on the external USB drive as well. It works very nicely and all, but for convince I personally prefer to run my rootfs off a NFS share.

The reason is simple. I can modify file 3 different ways like this.

  1. directly from the BBB

  2. from the NFS share host.

  3. from a Windows 7( or any OS for that matter ) dev machine using Samba and mapped network drives.

there is at least a 4th option, using WinSCP from a Windows machine, but I prefer using “native” tool as much as possible. So I stick with mapped network drives.

Hi William;

Thanks for the help so far. Actually this won’t help for my particular application.

What I am doing is designing a test instrument the user can access from a smart phone or tablet.

The instrument will use node.js and socket.io and communicate with the hardware via a web page.

The first part of the code is an RF Power meter, that reads one of the analog inputs on the BBB and

converts the reading to dBm.

This project is part of another book I am writing for Packt Publishing. Basically the reader can develop

the code on the BBB and then remove the USB memory stick, with the Cloud9 IDE on it and have a portable instrument.

At least that is my goal. So what I need to know is if:

PATH=$PATH:/media/disk1

Export PATH

is the right code to add to my “.profile” file and the equivalent for root.

You blog looks interesting, but my deadline is already past due J

Thanks again;

Bill

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

*node bin/cloud9.js -w /path/to/your/workspace*

Is this what you’re asking ?

Yeah. I think so. Here is my current path:

cat $PATH

cat:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/ubuntu/local/cloud9/:/home/ubuntu/local/cloud9/bin

I just enter: “cloud9.sh -l 0.0.0.0” from the SSH window and then it starts the server and I go to the Cloud9 IDE

with my browser.

This is an edited version of cloud9.sh There was a case statement that figured out what version of linux you were running.

I could probably just modify it to add the correct path?

William, I am not sure. It sounds reasonable, but I am unsure how this would work cross distro. Which I assume is why you’re asking.

Once you get the proper ENV variables set for Node.js, cloud9, and the workspace though, I would think it should work fine. Assuming I understand correctly what you’re asking.

It only has to work on Ubuntu, I forget which release. Version 13.10 I think.

Right now I’m down to my last working uSD card, so I can’t experiment until some more arrive.

I’ll post, once I have some more testing done.

Thanks;

Bill

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

William, in the future when you’re done with your book may I suggest using an NFS share for your rootfs. That is if you continue to do lots of experimentation with your rootsfs etc. It’ll save you from having to do loads of writing to sdcards.

I have two more useful posts on that blog site concerning using an NFS share only for the rootfs, and another that includes using TFTP to load your kernel via network ( NETBOOT ). These are not as short / concise as the USB boot post that I wrote, but the information is all there.

In the future I may make a shorter post on how to take any existing u-boot, kernel, and rootfs media, for use in a netboot / net rootfs configuration It’s really not that hard once you understand what u-boot expects,

Sure.

I’ll definitely look up the posts.

Sad fact is I’m a hardware guy with no choice but to write his own software, so I’m a bit behind the curve L

Thanks again.

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book