Vetals
Posts: 46
Joined: Thu Feb 28, 2013 10:37 am
Location: Eastern Europe

Raspbian on the HDD for booting (SOLVED)

Thu Feb 28, 2013 11:07 am

Hello community.

I have a quick question about booting from USB HDD.
Yes, before to post i googled, but my situation is unique.


I have a "465GB" HDD with ext3 and swap (128Mb) partitions. Ext3 has many files and folders, because i used this HDD with my router (rtorrent, ncdc usage, etc).

I want somehow Raspbian being installed to HDD, and then, by writing some simple for "/boot/config" on the SD card, force to load OS from HDD.

So the question is, can i install Raspbian to HDD without removing files (just renaming them)?
If yes, which tool can do this?

And i quess, even if installation will be successful, i still need correct "code" for "/boot/config" on the SD card.

Thanks in Advance.
Last edited by Vetals on Sun Mar 03, 2013 8:50 pm, edited 1 time in total.

User avatar
mrpi64
Posts: 931
Joined: Sat Feb 16, 2013 5:13 pm

Re: Raspbian on the HDD for booting

Thu Feb 28, 2013 1:27 pm

try making (or finding) an adapter, for SD to HDD. :D
I'm happy to help.
https://www.raspberrypi.org/forums/viewtopic.php?f=78&t=51794 - List of games that work on the Pi.

lewmur
Posts: 316
Joined: Sun Dec 25, 2011 3:20 pm
Contact: Website

Re: Raspbian on the HDD for booting

Thu Feb 28, 2013 1:45 pm

Vetals wrote:Hello community.

I have a quick question about booting from USB HDD.
Yes, before to post i googled, but my situation is unique.


I have a "465GB" HDD with ext3 and swap (128Mb) partitions. Ext3 has many files and folders, because i used this HDD with my router (rtorrent, ncdc usage, etc).

I want somehow Raspbian being installed to HDD, and then, by writing some simple for "/boot/config" on the SD card, force to load OS from HDD.

So the question is, can i install Raspbian to HDD without removing files (just renaming them)?
If yes, which tool can do this?

And i quess, even if installation will be successful, i still need correct "code" for "/boot/config" on the SD card.

Thanks in Advance.
It is possible to place all of the Raspbian files on the ext3 partition and then edit the /boot/config.txt file to point to that partition but it wouldn't be the easiest way. It would be much easier to use gparted to resize the ext3 partition and then create a new partition for the Raspbian image. The problem with trying to just copy the files to the existing partition is getting all of the permissions correct.

freakqnc
Posts: 9
Joined: Thu Feb 16, 2012 3:33 am

Re: Raspbian on the HDD for booting

Thu Feb 28, 2013 9:48 pm

mrpi64 wrote:try making (or finding) an adapter, for SD to HDD. :D
Looking for such an adapter myself (SD CardSlot to SATA). Sadly they don't seem to exist (yet). There is one that allows to put a SD card into a slot on an PCB that lets you connect that SD card to a SATA port on your computer (as if it was a SATA drive), sadly nothing in the realm of "vice versa".

I sent an email to tech support at Addonics (makers of all kinds of adapter cards, but nothing there either) and haven't got a reply yet.

Perhaps we should ask Limor Fried aka Ladyada (the gorgeous and talented mind behind Adafruit)? ;)

Whomever finds out something that lets us do that... could you let everyone know! Thanks! ;D

Cheers!

PS: maybe a model C could allow selectable boot from SD or USB that would be neat and there would be no need to build such a convoluted adapter since USB ports are already there after all and that shouldn't increase the price as much as needing to buy an extra adapter! :D
Are you listening Raspberry Pi Team? ;P

Vetals
Posts: 46
Joined: Thu Feb 28, 2013 10:37 am
Location: Eastern Europe

Re: Raspbian on the HDD for booting

Fri Mar 01, 2013 11:21 am

Thanks to all. Since my man-made USB self power hub has been died, i can't continue my tests, until i get a new one.

What currently has been done:

1. Backed up all files ( it takes so much time :D).
2. Destroyed all previous partitions, full reformat of the HDD. Creating 2 ext2 partiotions. First= 8Gb, Second=All free space.
3. With dd linux tool ( hopefully) wrote files from lastest Raspbian image with command

Code: Select all

dd if=Raspbian.img of=/dev/sdb1
(after some time, dd reported about this = OK).

But i cant see OS files being extracted to the destination, is this normal and should be like this?

P.S. I Not mixed up drives while installing Raspbian with dd.



Thanks.

User avatar
rpdom
Posts: 11522
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Raspbian on the HDD for booting

Fri Mar 01, 2013 1:28 pm

When talking about the image, do you mean you downloaded a fresh image file?

If so, you should extract it to /dev/sdb, not /dev/sdb1 (Caution: This will overwrite anything on the disk!).

Then disconnect the drive and plug it in again and you will see /dev/sdb1 (FAT) and /dev/sdb2 (ext4) - the same as on the SD card.

You then need to change the cmdline.txt file on the SD card so root=/dev/sda2 instead of /dev/mmcblk0s2.

Put those in your Pi and boot it up.

User avatar
Jim Manley
Posts: 1593
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Raspbian on the HDD for booting

Sat Mar 02, 2013 4:28 am

Be very careful what you wish for. The SD card interface is incomplete in that it can't communicate with SD cards faster than Class 4 (or maybe Class 6?) at the maximum speed possible due to a hardware feature left out that would allow the interface to achieve Class 10 speeds in a high-speed mode introduced for the faster classes.

So, you don't want to attach a hard drive to the SD card connector if you could. It will operate much faster via the USB bus even though there are issues associated with it (contention between the Model B wired Ethernet interface and USB devices, plus some additional bugs). Once you've booted from the SD card interface, you don't need to access it again until the next reboot or power-up if you move everything other than the /boot directory on the SD card to a USB thumb drive or hard disk drive (you can actually remove the card once bootup is complete).
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

Vetals
Posts: 46
Joined: Thu Feb 28, 2013 10:37 am
Location: Eastern Europe

Re: Raspbian on the HDD for booting

Sun Mar 03, 2013 8:36 pm

Once again, big thanks to all for replies, i succeed in this.
@rpdom yes, fresh and latest image of Raspbian from their website.

Now, i would like to write small tutorial.

1. You need a blank HDD ( without files, folders) , with only 1 partition available.
2. Connect you HDD to big PC, or to Rasbperry pi (as i did, but in this case i had to free up about 1.9 Gb for free space).
3. Detect, how HDD was named in the system, for example sda or sdb, etc... This can be done on the terminal under root with command:

Code: Select all

fdisk -l
and of course, check the command

Code: Select all

mount
If your disk has been mounted for usage, you have to unmount its back, and then do the next stage.
4. Get latest (fresh) version of Raspbian from their website. When you get the Raspbian zip file, unpack contents of it to some folder ( on the mounted file system).
5. Open terminal again, and write

Code: Select all

dd if=/your_path_to/Raspbian.img of=/dev/sdb
Note:
a) /dev/sdb is probably path to your HDD ( read stage 3 of this tutorial for more information)
b) You dont need to insert a number to /dev/sdb ( for example /dev/sdb1) because in this case, you burn the image directly to the whole disk.
c) When dd done burning, you will be noticed about this in the terminal.


6. Unplug your HDD, and plug it again.
7. Now you can see, that Raspbian image is Very SMART image, and has created two partitions on your HDD. First partition (FAT) never will be needed (until direct boot from USB without SD card, which could be planned by broadcom and/or Raspberry Pi Foundation), second partition contain installed Raspbian.

8. Next, you need a program GParted. For Raspbian its

Code: Select all

apt-get install gparted
Run GParted and resize your partition where Raspbian has been installed. If you need my advice, i left about 10Gb for Raspbian, and other space i left for new ext2 partition, where all my media files will be kept.

9. On the SD cart, in the FAT partiotion find the file called cmdline.txt
Open it, and change

Code: Select all

root= /dev/mmcblk0s2
to

Code: Select all

root=/dev/sda2
Save the file and close it.

10. Now boot up your Raspberry Pi with this HDD connected via USB.
11. If you succeed, then accept my congratulations, you've done everything correctly, otherwise read this tutorial again.

Good luck.

a9971256
Posts: 43
Joined: Fri Jun 07, 2013 11:02 pm

Re: Raspbian on the HDD for booting (SOLVED)

Thu Sep 12, 2013 1:56 am

http://devstuff.no-ip.biz:890/?page_id=50
That is a page on my website on setting up Hard Disk Boot

Return to “General discussion”

Who is online

Users browsing this forum: kaksi and 57 guests