Browse Local Files on Your Cr-48

There has been a lot of buzz around the internet about the Cr-48 and one of its major weaknesses, the inability to browse the file structure on your SSD.  The problem is that the “file:///” method in your search bar that you would use in the browser version of Chrome is only allowed access to your ‘Downloads’ directory in Chrome OS.  The content Browser is similarly restricted.  This means that the only way to navigate your disk is by using the shell.  But even then, there is no way to open and view files such as images and audio files (at least I haven’t found a command line image viewer that is installed).  This also means that the only way to browse USB media and your SD card is through the terminal.

Until now, the only solution I’ve seen is to navigate to a site like Aviary which uses the SWFUpload file browser.  SWFUpload manages to get access to the entire file structure and let you browse your whole device.  This is a step in the right direction, but it is still limited because you can’t really do anything with your files using their browser (like open them to view without uploading).

By enabling the “Advance File System” option in Chrome://flags, and SD card will show up in your content browser but cannot be opened or browsed.  Even pointing “Chrome://slideshow” to the media directory only results in files that are incapable of supplying a preview.

 

Here you can see the SD card in the content browser. However, at this point, clicking it does nothing

Today I spent some time trying to figure out how I could deal with this problem.  After spending some time trying to point the “Chrome://slideshow” and the “File:///” utilities to different locations with no success, I had an idea.  The only directory that anything in Chrome OS can see is “Downloads”.  If only I could somehow move EVERYTHING into the Downloads folder.  Clearly that isn’t really possible, or preferable.  BUT, a symbolic link might achieve the same result.

So I opened up the terminal and created a symbolic link from my “~/Downloads” directory to my “~/”  and called it home.  The command looked something like this “ln -s ~/ HOME”.  Switching back to the browser view and pressing ctrl + o I was greated with a link to HOME in the content browser.  Clicking it resulted in this:

Excited from my success, I went ahead and added symbolic links to the “/media” directory as well as the “/” directory, naming them “media” and “root” respectively.

 

Now the view inside my Content Browser looked like this

Navigating through the media link that I now had in my Downloads folder I was able to access my SD card.  Clicking on the image file name I was greeted with this:

 

A file on my SD card successfully browsed to and opened with the "chrome://slideshow" utility

Success!!!

It is also worth noting that the content browser isn’t necessary for all of this either.  Using the File:/// utility, the symbolic links show up as navigable folders.  So you can browse your content, and clicking on images opens them in the browser window for preview.

So there you have it, a way to navigate and view files from your storage, both local and usb/sd.

So far, I haven’t managed to get anything to download directly onto the SD card (or any folder other than Downloads).  The symbolic links do not seem to have solved that problem.  I plan to spend some time later this evening and tomorrow seeing if I can figure out why.  And hopefully solve it.

*EDIT:

Thanks to PabloBasico I now know that my symbolic link hack above opens up a really great function, drag and drop onto your flash media!  As he pointed out in a comment below, when you have two content browsers open, it is possible to drag and drop files between them.  Navigate one to SD card via the symbolic link and you can quickly drag files from your downloads folder onto your SD card or vice versa.  This is a really great feature allowing me to download files onto my Cr-48 and then move them to my SD card without ever opening up the terminal!

*EDIT:

So a lot of people in the comments have been having small issues getting this to work.  I’m not really sure why, but sometimes the links are showing up as files and not folders in the content browser and other problems.  Today I had to redo the setup on my Cr-48 because I recently booted from recovery to fix a messed up partition table.  I figured I’d take that opportunity to take a screen cap of my terminal inputs for clarification.

So, to revamp:

You MUST be in developer mode for this to work.  Directions for transitioning into dev mode can be found here.

Then enable advanced file system.  Type about:flags into the address bar and then click enable on the AFS option

ctrl+alt+t gets you to a terminal

‘shell’ takes you to a bash terminal

‘cd ~/Downloads’ navigates you to the Downloads folder

‘sudo ln -s /media MEDIA’ creates the symbolic link in your downloads folder to your mounted media

 

Hope this helps you guys out, I’m probably going to re-write the whole post more specifically and concisely when I get a chance.

Advertisements
    • PabloBasico
    • January 2nd, 2011

    Very Nice!
    Thanks Much,
    Paul

      • theGnartist
      • January 2nd, 2011

      Thanks for reading PabloBasico! Let me know if you have any success writing to the SD card from the browser. I’m still a little hung up on that one.

      • Howdy Gnartist,

        I don’t know if this is exactly what you are looking for but I have found a way to write to my sd card. After you did the Browse Local Files work, it seems too simple!

        Open two file browsers.
        Navigate to the sd card by way of the media symbolic link created previously.
        Drag and drop the file to the card.

        Thanks again for your information,
        Paul

    • theGnartist
    • January 4th, 2011

    Thank you PabloBasico for pointing that out. Being able to drag and drop has pretty much quieted all of my issues with the way the Cr-48 handles external media. I a can’t believe I overlooked this simple but really useful feature!

    • libssd
    • January 6th, 2011

    Thanks for a very nice write-up. One question of clarification: I haven’t flipped the switch yet, but I’m assuming that in developer mode, you can summon a linux shell from the crosh command line. OR, in developer mode, does Ctrl-Alt-T dump you into a linux shell, rather than crosh (which I assume stands for chrome shell)?

      • theGnartist
      • January 6th, 2011

      Thanks for reading.
      Once you flip the developer switch, you have a new command in the crosh terminal. By typing ‘shell’ you get to a standard linux shell.

        • Selden
        • January 6th, 2011

        All is revealed. This explains why typing “shell” at the crosh command line prompt does nothing.

    • jaxcoffee
    • January 6th, 2011

    So what is keeping someone from writing an app to preform those functions?

      • theGnartist
      • January 6th, 2011

      I’m not sure. I’ve been looking into an app/extension to do this, but right now I’m more focused on being able to do native development. The only issue I see with an app is that this requires dev mode and root privileges. Not everyone enables that on their Cr-48, so the App wouldn’t work universally. I’m also unsure if an App would have sufficient privileges to be able to create the symbolic links. I’ll look into it and see if I can figure something out.

    • Inf
    • January 10th, 2011

    This in wonderful! I’m having trouble getting it to work though. I’m have no idea how ChromeOS/Linux works…

    I type “ln -s ~/ HOME” in terminal without the quotes, but it says that the command is unknown.

      • theGnartist
      • January 10th, 2011

      Thanks for reading, Inf.
      Are you in developer mode on your Cr-48? If you haven’t switched the dev mode switch you will not have access the full linux shell.
      If you are in dev mode, when you first get to the terminal it takes you to the ‘crosh’ terminal, which is very weak and doesn’t have the necessary commands. In the crosh shell type the word ‘shell’ and this will give you a normal bash shell.

      From there, the ln command should work fine.
      Let me know if you have any more questions

        • Inf
        • January 10th, 2011

        Thanks for that. The command seems to have been processed successfully with the bash shell, but ‘control + o’ still looks the same. I only see “File Shelf” and it’s empty inside. I have advanced file system enabled in flags.

        • Inf
        • January 10th, 2011

        Actually, the problem I’m getting now is this message: “Read-only file system.”

    • libssd
    • January 10th, 2011

    Am I correct that, in developer mode, Chrome OS will automatically be updated to the latest development (possibly unstable) build? If you want to use the latest stable build, you have to switch back out of developer mode.

    I’ve seen at least one report that the Cr-48 seemed faster in developer mode; maybe I’ll give it a try.

      • theGnartist
      • January 10th, 2011

      libssd, I’m not sure about the update scheme from Google. As far as I know, as long as you don’t mess with the stateful partition, updates will go normally though.

    • Selden
    • January 10th, 2011

    Well, that didn’t go too well. Following procedure at: http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/cr-48-chrome-notebook-developer-information

    I eventually ended up at a screen that said I had to re-install Chrome OS from a USB. I flipped the developer switch back to its default position, rebooted, and was able to get back to normal. I’m guessing that the problem I’m running a secure WAP, and while booting in developer mode, there was never a request for the access passphrase.

    Nothing lost except a little bit of locally stored data, pretty much just like the guy says in the “destroy your Cr-48” video on YouTube.

      • theGnartist
      • January 10th, 2011

      Selden, was the screen you saw a blueish green colored frowny face? If so, then all you had to do was press ctrl + d to boot into Chrome OS. This screen will always appear when in dev mode but ctrl + d bypasses it and allows you to boot no problem.

        • Selden
        • January 11th, 2011

        No, this was after Ctrl-D, and after about a 5-minute wait while it switched to developer mode.

        • theGnartist
        • January 11th, 2011

        Interesting, I haven’t heard of anyone running into this problem.

        • Selden
        • January 11th, 2011

        Meh, I got it back into default mode with minimal effort, apart from taking a new (slightly less bad) self-portrait, entering the 27-character access code for my WAP, and re-establishing passwords for some sites. If I need to to local things, I have a netbook and a desktop, so I’m perfectly content to leave the Cr-48 in default mode.

    • Sarah LF
    • January 10th, 2011

    Help! I figured out how to open a terminal
    I learned about symbolic links and it took me forever to figure out that the first letter in this is a lowercase “L.” (I’m new at this!)
    I changed it to shell.
    I typed in ln -s ~/ HOME
    But now what do I do? When I open the downloads folder it isn’t there.
    You said to repeat this to make a media file and root file.
    But I can’t figure any of that out! Would you please walk me through what to type once I’m in the terminal and type “shell”??? I hope that’s not asking too much. Thanks so much for all of this!

      • Inf
      • January 10th, 2011

      I’m in the same boat. After typing the line, I get an error about the file system being read only. Is that what you’re getting too?

        • theGnartist
        • January 10th, 2011

        If you are getting read only problems it is a sign that you don’t currently have root privileges. Fix this by appending “sudo” at the beginning of the ln command.

      • theGnartist
      • January 10th, 2011

      Okay,
      1. “ctrl +alt +t” this takes you to the chrosh terminal
      2. “shell” this start a standard bash terminal
      3. “cd ~/Downloads” cd is for ‘change directory’. So this takes you to your Downloads folder
      4. “sudo ln -s ~/ Home” sudo gives your super user permissions so you can read/write here. ln (thats lowercase L) -s creates a symbolic link. ~/ is the path to your root directory (this is the target of the symbolic link) Home is the name the link will show up as in your browser.
      hope this helps

        • Inf
        • January 11th, 2011

        It does, thank you! I didn’t cd… I knew something was wrong because that line doesn’t have anything relating to the downloads folder in it… I’m having the same ‘read-only’ problem doing the media folder now though. I’m doing it the same way. Sudo precedes the command and I even tried it as localhost. I think that’s higher than chronos@localhost… right?

        • Sarah LF
        • January 11th, 2011

        Thanks for your response. I was able to do some it. I hit Ctrl + O and I see the two folders “Home” and “Downloads” but when I click on either of them it says “Unknown file type.” What did I do wrong?
        FYI, I did the following:
        Your steps above, 1-4
        “sudo ln -s ~/ Home”
        “sudo ln -s ~/ Media”

        Once I did the first sudo, this strange text comes up about a lecture from the system administrator, then that it boils down to 3 things, the last being “with great power comes great responsibility.”
        huh?

        • Sarah LF
        • January 11th, 2011

        Oh and “Media” and “Home” show up but with a page-like avatar to the left, not a folder.

    • Inf
    • January 11th, 2011

    Sarah LF :
    Oh and “Media” and “Home” show up but with a page-like avatar to the left, not a folder.

    I’ve just spent some time looking this over (I’m a noob) and researching a bit on Google and have figured it out. ln –help and ls –help FTW! For the sake of completeness, I’ll retrace theGnartist’s steps:

    1. control + alt + t for crosh terminal.
    2. type ‘shell’ for bash terminal.
    3. type ‘cd ~/Downloads’ this means we’ll be working in ‘Downloads’ folder which is what control + o brings up.
    4. type ‘sudo ln -s ~/ Home’ I think you messed up here some how which is why the ‘Home’ link in your ctrl+o is a file and not a directory.
    5. type ‘sudo ln -s /media Media’ for the media folder.
    6. type ‘ls -all’ to double check. Any red text means bad symbolic links (I think). You can remove these with the ‘rm’ command. For instance, ‘rm Home’ will remove the bad ‘Home’ link you have now.
    Reply back with any problems. If it’s something simple, I may be able to help while theGnartist is busy or something.

    Thanks again to theGnartist! Now, I don’t have to upload my pictures to look at them!

      • Sarah LF
      • January 13th, 2011

      Thanks for all of your help everyone. I’m not having any luck. I’m doing the commands as they are written. I do “ls -all” and see the files (not folders) in red. I tried removing them but it said that media is a read-only file. I don’t know what else to do. Thanks in advance.

      When I try and do “ls –help” it all goes by too fast that I can’t see it all. I remember eons ago when I used brief that there was a way to slow it down. Anyone know how to do that?

    • libssd
    • January 12th, 2011

    Sarah LF :
    Once I did the first sudo, this strange text comes up about a lecture from the system administrator, then that it boils down to 3 things, the last being “with great power comes great responsibility.”
    huh?

    That’s just a standard Linux disclaimer, warning you that you could put your eye out with this thing. Or, as the author of The Unix Philosophy wrote, “…Unix… effectively hands the unititiated user an assault rifle, plugs in 20 rounds, and points it at his foot.” Have fun, be careful.

    • libssd
    • January 13th, 2011

    Sarah LF :
    Thanks for all of your help everyone. I’m not having any luck. I’m doing the commands as they are written. I do “ls -all” and see the files (not folders) in red. I tried removing them but it said that media is a read-only file. I don’t know what else to do. Thanks in advance.
    When I try and do “ls –help” it all goes by too fast that I can’t see it all. I remember eons ago when I used brief that there was a way to slow it down. Anyone know how to do that?

    Sarah, I probably have considerably more *nix experience that you, and i’m not willing to try what you’re doing!

    To view the output of ls –help (you need two dashes, not one), pipe the output through a command called “less”.

    ls –help | less

    Space bar will page through the output one screen at a time.

    Not sure why you would get a read only error when attempting to use rm, but you could try using your super powers with: sudo rm

  1. Howdy,

    I had to do some research to get his stuff to work. I am certainly new to the terminal.

    A couple things I remember that helped me are:
    Scroll within the terminal with two fingers on the touch pad,
    and, for virtual link help, enter the 9 following characters,

    ln –help

    The help for creating the virtual links did the trick for me. I hope this helps.

    Paul

    • libssd
    • January 14th, 2011

    It took me a while to figure out what was going on here, but WordPress (which powers this blog) has a “feature” that may cause problems for those without prior Linux experience. Typographically, two dashes (hyphens) are equivalent to what printers call an “M-dash”, that is, a dash that is approximately the width of the letter M.

    Unfortunately, WordPress is automatically converting double-dash to M-dash. While this looks good, it is catastrophic for Linux commands. Thus, in the examples provided by Paul and Sarah, the syntax should be:

    command dash-help (that is, help is preceded by two dashes)

    I hope this reduces confusion.

    Since I ran into a significant problem when trying to enable developer mode, I don’t know if Linux documentation pages are part of Chrome OS as installed by Google on the Cr-48, but if they are, an alternative syntax is: man command. Examples:

    man ls
    man ln
    man rm

    • eric
    • January 24th, 2011

    uhm so i did this and I got a media in my download folder when i press ctrl o, is that how its suppose to be?

    • Tyler Lovelace
    • February 10th, 2011

    Thank you so much for this 😀
    I would also like to add a note: If you feel the need to add a folder (create a new one), you can just sudo cd to where you want and use the mkdir command.
    Like this:

    “sudo cd ~/Downloads”
    “sudo mkdir Pictures”
    and you can even create a hierarchy of folders (useful for photos)
    “sudo cd ~/Downloads/Pictures”
    “sudo mkdir 2011”
    “sudo cd ~/Downloads/Pictures/2011”
    “sudo mkdir January”
    and so on and so on

    Yes, it’s alot of work, but it’s defiantly worth it in order to have some illusion of organization.

    • Tyler Lovelace
    • February 10th, 2011

    egh… cancel that comment please…
    Apparently, you can’t move files into the created folders :/
    Maybe you can in terminal, but that would be far to inconvenient.

    • Loren Amelang
    • April 21st, 2011

    It is now April 21, and I’m on 0.11.257.91 beta. My Content Browser by default shows
    stateful_partition
    SANVOL [My SD card]
    File Shelf

    I can navigate through the SD card and click files, and their names show up in the address bar, but the Slideshow is always plain black.

    When I click File Shelf, the title of the Content Browser changes to Downloads, and I see the files in ~/Downloads/ – my downloaded files and screenshots. They open as pure black as well.

    When I try this symlink trick, I get another view of the SD card inside FileShelf / Downloads, and the files still open pure black when I click them. If I drag them to the address bar, they display properly, but I could do that from the original SANVOL view.

    But it is cool to be able to see home and root, and drag log files to the browser window!

  1. January 4th, 2011
  2. January 7th, 2011
    Trackback from : Using the SD card slot
  3. January 10th, 2011
  4. February 10th, 2011

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: