Author Topic: Linux from an SD card?  (Read 17535 times)

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Linux from an SD card?
« on: July 20, 2010, 10:00:46 PM »
So, I've been thinking about trying linux out on this thing. Of course, I still don't know if my wireless card is actually supported or not.

But Since my burner is useless, I was wondering if there was a way to install a distro from an SD card. I don't mean run a live distro, but actually boot the installer and install linux onto a partition from the card.

And while I'm at it, I'll ask which distro would be a good idea for me to check out, since every time I chose one, I end up screwed over, either by something with no real support because it's to new, or by something that is just stupidly unstable and unusable (oldschool fedora :<)
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #1 on: July 21, 2010, 01:40:45 AM »
As long as your system supports booting from your card reader (kind of hit or miss, really, though I think my 2005 Dell Inspiron 9300 can do it, so I imagine most newer ones should be able to do that) it should be similar to cramming an ISO onto an SD card.

Of course, LiveCD distros would be much more suited to doing something like that (and have the benefit of including LiveUSB scripts, for the most part), so for best results you'd have to find something that can be bootstrapped from within another system (Debian and Gentoo are the only two that come to mind, though I'm sure you can get Ubuntu to install like that without too much hassle).

Or, if you're patient, I could mail you a CD/DVD with your distro of choice on it.  Your call.

And while I'm at it, I'll ask which distro would be a good idea for me to check out, since every time I chose one, I end up screwed over, either by something with no real support because it's to new, or by something that is just stupidly unstable and unusable (oldschool fedora :<)

I've actually found Fedora 13 to be rather good, surprisingly.  I was vehemently anti-Fedora for the longest time due to the sheer number of issues that it had, but after installing Fedora 13 (I literally only installed it because I wanted a fully functional system to bootstrap Gentoo from that wasn't Ubuntu) I've actually found it to be extremely solid.  I'm far more impressed with F13 than any release of Ubuntu.

Of course, Gentoo is still muh tru bebbeh.  I can't say I'd recommend it for a laptop, though, due to the sheer amount of downloading and compiling you'll have to do to install, well, just about anything.  I used to recommend Debian on laptop, Gentoo on desktop, but I think now I'd rather use Fedora in any case where binary, desktop-oriented distributions are preferred.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #2 on: July 21, 2010, 06:47:11 AM »
I take it I'll need to reboot to check my bios to see if it supports running off the reader? (That doesn't happen often, since Hibernate is a thousand times more useful)

Well, I was almost thinking I might want to try my hands at gentoo. After having played around in busybox, and muddles my way through installing stuff by source using an unfamiliar package system, an SSH console, and all the rest, I thought it could be a good learning experience. Of course, I'd still need a good tutorial on compiling that beast, just in case.

I was looking at trying to do that with Ubuntu, after having looked at a couple different distros, but I thought I should ask since you've had a lot more experience with different distros.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #3 on: July 21, 2010, 04:55:51 PM »
I take it I'll need to reboot to check my bios to see if it supports running off the reader? (That doesn't happen often, since Hibernate is a thousand times more useful)

Hibernate shuts down the computer entirely, so you can hibernate it, power it on, and go into the BIOS without losing your system state.  Bear in mind that you might need to have a device plugged in for it to actually show up on the boot list.

Well, I was almost thinking I might want to try my hands at gentoo. After having played around in busybox, and muddles my way through installing stuff by source using an unfamiliar package system, an SSH console, and all the rest, I thought it could be a good learning experience. Of course, I'd still need a good tutorial on compiling that beast, just in case.

Using Gentoo really isn't all that hard, but it does require patience.  Some particularly painful packages (i.e. Firefox, OpenOffice, etc) are available as binary packages assuming you use the x86-32 version of the distro.  Configuring the kernel is by far the most painful part, but there is a generic kernel available that works well in 99% of all cases, so even that's not really a necessity.

As far as package management goes, that's all done automagically through the Portage package manager.  You don't have to actually dig in and manually compile anything.  Installing X is as simple as typing "emerge xorg-x11".

Best of all, the entire installation process is explained in meticulous detail: http://www.gentoo.org/doc/en/handbook/index.xml.  The directions are based on building Gentoo from the Gentoo LiveCD, but, really, the instructions are applicable to any environment.  Like I said, I bootstrapped my Gentoo system from Fedora without a problem.  All you need to do from your host environment is be able to do is create and mount partitions, download files, copy over the resolv.conf from your live system, extract bzipped TARs, and chroot into the environment (oh, and access the web so that you can view the handbook, if you don't have another system available ;)).

If you need a hand during or after the installation is complete, feel free to ask.  Gentoo is a meta-distribution and as such can be configured to do just about anything, so it's pretty easy to get overwhelmed.  I think I've built enough Gentoo systems that I can give you a lot of help with it.

I was looking at trying to do that with Ubuntu, after having looked at a couple different distros, but I thought I should ask since you've had a lot more experience with different distros.

Damn straight. 8)

I really don't recommend Ubuntu for much of anything nowadays.  About the only advantage that I see in it is that the user community is overflowing.  Like I said elsewhere, I had issues simply assigning my computer a static IP address, only to have 1501495834[/tweet]]someone tell me that it's not something that novices normally do.  Huh.  As good of an excuse as any, I suppose.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #4 on: July 21, 2010, 05:05:48 PM »
Alright, I'll try that whenever I feel like getting that ball rolling. I learned a lot by sshing into busybox, so I'm a lot more at ease with the command prompt now :P
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #5 on: July 22, 2010, 02:01:28 AM »
So, I updated my BIOS. Still no option to boot from the SD card reader... I noticed though that the card reader shows up as a USB device... Would setting my system to boot from USB work, if that's the case?

Edit: How do I get the contents of the ISO onto the SD card properly for this? I know you can just extract files from an ISO, but would it still be bootable if I did that?

Edit2: Ok, so I downloaded UNetbootin, and I'm gonna see if I can get that working. I'm in class right now, so I haven't had time to test it yet, but maybe I'll get lucky and my card reader will show up as USB bootable. It showed up as a USB device in UNetbootin.

Yet Another Edit: Looks like it doesn't detect the card as bootable or something. I'm gonna try using the 2008.0 one that UNetbootin is apparently compatible with, and see if that actually works. But it looks like I'm gonna be stuck here, if things don't start working.

Edit: A New Hope:
Well, I'm online in the basic "Live CD". I ended up buying a $3 memory stick (1GB) and it installed fine on it. Of course, now I need to figure out how to resize my windows install, and how to dual boot this thing without blowing it up. Any suggestions there? (Also, this edit was performed in Links in text mode running off that flash drive install :P)
« Last Edit: July 22, 2010, 06:47:06 PM by Bobbias »
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #6 on: July 22, 2010, 08:20:12 PM »
Many SD card readers are connected via an internal USB header, so that might be why it came up like that.  Odd that it didn't let you boot from it, though.  That stuff is all pretty standard.  It might be an issue with the particular card that you were using...hard to say.  I was able to successfully boot my I9300 using a Sandisk microSD card in an adapter before.  Either way, it's kind of a moot point if you have a memory stick now. :p

I'd probably go with something a bit better than the standard LiveCD.  You could resize the NTFS partition using parted, but...uh, no, you really don't want to do that.  It pretty much puts the risk back into the resize process because it's pretty much all manual.

You'll probably be best off prepping the drive with the gparted live environment.  It'll give you the ability to resize your NTFS partition in a somewhat safe manner (there's always risks, of course, but I've never had gparted eat a partition of mine yet, and I've resized a partition on a RAID 1+0 array, which is probably the most dangerous thing that you can do in Linux due to its abysmal support of fakeraid configurations that have anything to do with RAID 1).  I'm not sure if that particular LiveCD has any networking support, but if it does you should be able to do your bootstrapping in there.

Another option would be putting together a Slax build on your memory stick with support for your hardware (if it doesn't support it out of the box) with gparted.  That would still yield a fairly light download, but would give you an environment that you could do everything in.

Finally, if you don't mind downloading something OMG HUEG (OMG HUEG meaning a 688.55 MB ISO via either a well seeded torrent or FTP), you can always go with Knoppix.  Knoppix has everything including the kitchen sink, so if you can't resize the partition and bootstrap Gentoo with that you'll never be able to do it. :)
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #7 on: July 22, 2010, 08:36:31 PM »
Lol, well, for now I'm trying to do it all from my memory stick gentoo. And It wasn't actually the Live CD, is was the minimal CD. I just downloaded the Stage3 and just finished extracting it before I posted this. Now it's time to install portage, and configure my compiling optimizations. I'm gonna be so happy when I can get something more than a terminal environment. I forgot how much the internet SUCKS in text mode.

EDIT: Not good, I'm getting errors trying to extract the portage package.

It's saying: Cannot change ownership to uid 250, gid 250. Operation not permitted.

That happens whether or not I have the j option when extracting. The hell is going on? I've got nearly 8 GB on that card, and it'd be damn nice to be able to use that along side the 1GB of this flash drive.
« Last Edit: July 22, 2010, 09:05:20 PM by Bobbias »
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #8 on: July 22, 2010, 08:48:41 PM »
Not cool, apparently I've run out of space on the flash drive... Really not cool. I think I'm gonna have to try to see if I can use the sd card to hold some of this, lol.

Also: how do I get linux to not read out huge help listings without pausing to let me read the stuff at the top? I know you can do that in dos, but I don't know how to do it in linux :/
« Last Edit: July 22, 2010, 09:10:34 PM by Bobbias »
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #9 on: July 22, 2010, 10:06:12 PM »
You have to extract the stage3 package and portage snapshot onto the hard drive, not the flash drive.  Remember, Gentoo is a source-based release, so you have to keep the toolchain on the system at all times.  Additionally, compiling other packages (especially big, bad X environments) is going to take a ton of space.

So yeah, you'll have to use gparted to pare down your NTFS partition a bit and install it to the hard drive.  The LiveUSB should only be used to bootstrap the system if you intend to use Gentoo.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #10 on: July 22, 2010, 10:25:08 PM »
:/ can I get binaries of gparted? As it stands, I don't think I have a working environment to build anything from source.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #11 on: July 22, 2010, 10:40:24 PM »
Ok, this is retarded. I need development utilities to build gparted, but I need to have already set up a partition for gentoo before I have the fucking development utilities, from what I can gather.

This is why I do not like shit that just tells you what to do, and doesn't give you a chance to do things differently... Why doesn't the gentoo manual have a section on "if you need to resize partitions, before you install it, do this" or some similar section? I'm beginning to consider just tossing knoppix on that flash drive...
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #12 on: July 22, 2010, 11:02:23 PM »
Uh, that's why I gave you a direct link to the gparted LiveCD... :/

And there's a damn good reason the Gentoo docs don't tell you how to resize partitions: from a terminal it's incredibly dangerous.  If you download the LiveDVD, gparted is included for that very reason.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7210
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: Linux from an SD card?
« Reply #13 on: July 23, 2010, 12:58:30 AM »
Ok, this is fucking retarded. Even Gparted isn't working.

Every time it tries to start up x window system, it either hangs (if I try to manually set stuff) or simply complains that no screens are found.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5716
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: Linux from an SD card?
« Reply #14 on: July 23, 2010, 09:26:01 AM »
Okay then, give Knoppix a shot.  Sounds like the Gparted LiveCD doesn't have workable X drivers for your video hardware (which is odd, since most recovery disks will happily use vesa if nothing suitable can be found, and all three of the major video card chipsets support vesa very well).

Knoppix, on the other hand, is based on Debian and I've had a lot of luck with Debian's hardware autodetection (not to mention that last time I tried Knoppix it was able to pick up my laptop's wireless card, which was a very new chip at the time that I tried it).  If your memory stick is large enough, the Gentoo LiveDVD might also be something to consider.  Gentoo's hardware detection is stellar.
"This is a machine for making cows."