Page 1 of 1

Headless setup

Posted: Thu Aug 13, 2015 9:30 am
by StrawberryRho
Hi

I try to do a headless setup of a Raspberry pi from an Archlinux machine. I downloaded the Raspbian image from the official website and use this command

Code: Select all

dd bs=4M if=2015-05-05-raspbian-wheezy.img of=/dev/sdc
That seems to work fine, at least it takes a while and the SD card blinks as if data is written onto it. Once I've issued this command, I cannot mount the SD card anymore and the only way I found to access it is to destroy the partition table and the master boot record of the SD card. But for all I know, that might be fine. So I tried to insert the SD card into a raspberry pi Model B+ V1.2. It does not get assigned an IP, so I think something went wrong with writing the image onto the SD card. When I start the Raspberry Pi, the ACT LED is green and the PWR LED is red, no matter if I have the SD card inserted or not. I'd expect to see some more LED's flashing up if reading from the SD card would succeed.

What might have gone wrong here?

All help is much appreciated.

Re: Headless setup

Posted: Thu Aug 13, 2015 10:34 am
by KLL
try a other SD card,
because after burning the Raspbian image to a SD card you can read
from any system the SD card vfat /boot/ partition (56MB?)
even the rest you should be able to mount from your linux system

Re: Headless setup

Posted: Thu Aug 13, 2015 10:39 am
by Joe Schmoe
If this is your first (or second or third) time setting up a Pi, you really should get K, V, and M connected so that you can see what's going on.

While it is theoretically possible to do a "headless" setup as the first time out of the gate, the odds are against you for getting everything right the first time.

Re: Headless setup

Posted: Thu Aug 13, 2015 11:48 am
by StrawberryRho
Hi

Thanks for the help.

I have only one SD card and it's a new one, so I don't think that's the issue here. And after destroying partition table and master boot record (not sure if both was needed), I can easily mount it again. I will test it with another SD card if I find a cheap one.

I'm not sure what's meant by K, V and M, but I suspect that K stands for Keyboard and M for Monitor. Could also be a mouse. Anyway, I don't have these things and it should be possible to do a headless setup. Further I don't understand what you mean by "getting everything right the first time". The setup, as described by numerous tutorials online, is quite easy...

But I guess that the way I'm setting it up is not obviously faulty, so I'll continue trying.

Re: Headless setup

Posted: Thu Aug 13, 2015 11:57 am
by rpdom
StrawberryRho wrote:I'm not sure what's meant by K, V and M, but I suspect that K stands for Keyboard and M for Monitor. Could also be a mouse.
The usual trio is Keyboard, Video and Mouse.

I mostly run headless. For initial setup I put the card in a reader in a Linux system and sort out all the settings on there first.

I've hardly ever used a mouse with a Pi. I have a TV connected to one, which gets used fairly often to play videos on (controlled via ssh), and a monitor connected to two others (one via HDMI->DVI-D, one via Gert's VGA666-> VGA) which never gets switched on

Re: Headless setup

Posted: Thu Aug 13, 2015 12:37 pm
by kusti8
Even though the SD card may be brand new, it could still be at fault. Buy a different 4 GB one (they're not that much) and try again.

Also worth trying is a different laptop, as some builtin SD card readers don't work very well for writing the image.

Re: Headless setup

Posted: Thu Aug 13, 2015 2:54 pm
by StrawberryRho
Well, thanks for all the help, but I'd rather understand the issue than work around it by buying various new things.

Re: Headless setup

Posted: Thu Aug 13, 2015 3:12 pm
by B.Goode
StrawberryRho wrote:Well, thanks for all the help, but I'd rather understand the issue than work around it by buying various new things.
A Raspberry Pi can only perform an initial boot by reading the required files from a FAT-formatted partition on a (micro)SD card.

Most Operating Systems - including all desktop/laptop versions of Windows that I know about - know how to mount and access files on a FAT partition.

It follows - I think - that if you cannot see any files on your prepared SD card then the RPi will not be able to boot from it. In turn, I think that indicates that your (micro)SD card has not been prepared correctly. That might be due to a fault in the SD card, a fault in the card reader/writer that you are using, or something wrong in the way you are writing the card.

I agree, it is possible to carry out an initial installation of Raspbian entirely without any local peripherals attached to the RPi. The trouble is, as you have discovered, when it does not work you have little 'leverage' to try to debug the situation.

Re: Headless setup

Posted: Thu Aug 13, 2015 4:00 pm
by JumpZero
StrawberryRho wrote: Once I've issued this command, I cannot mount the SD card anymore and the only way I found to access it is to destroy the partition table and the master boot record of the SD card.
Do you wait until the command (dd) finishes? dd takes several minutes and issues a success message at the end (telling how many block were written).
--
Jmp0

Re: Headless setup

Posted: Thu Aug 13, 2015 4:03 pm
by Joe Schmoe
JumpZero wrote:
StrawberryRho wrote: Once I've issued this command, I cannot mount the SD card anymore and the only way I found to access it is to destroy the partition table and the master boot record of the SD card.
Do you wait until the command (dd) finishes? dd takes several minutes and issues a success message at the end (telling how many block were written).
--
Jmp0
And don't forget to:

Code: Select all

sync;sync;sync
before removing the card.

I think people tend to forget this piece of 20th Century advice, but it can matter. I have had instances where I didn't do it, and the card didn't get written right.

Re: Headless setup

Posted: Fri Aug 14, 2015 7:47 pm
by StrawberryRho
It works now!

It's a bit embarrassing but I still don't know what caused the problem, since I did it exactly the same as before. I suspect that something went wrong while downloading the file, I haven't checked the MD5 checksum. This is very unlikely but I don't have a better explanation why it didn't work the first time.

Thank you all guys for the helpful suggestions!