[kwlug-disc] Booting the Raspberry Pi from a hard disk

CrankyOldBugger crankyoldbugger at gmail.com
Mon Feb 11 17:26:14 EST 2019


Don't quote me, but I seem to recall something about the later versions of
the Pi being friendlier to the idea of an external HDD.  Better power
management or something like that...  I'll see if I can find where I saw
that.


On Mon, 11 Feb 2019 at 17:24, Stuart Seeley <stuart at lowlevel.ca> wrote:

> I'm curious how this performs for you guys... I seem to recall some kind
> of hardware limitation where the ethernet and the usb couldnt work at the
> same time...
>
> ie: I would download a file over smb... and there would be disk reading or
> network activity but never simultaneously...
>
> Might have been raspberry pi 1 or 2...
>
> Stuart
>
> Sent from my iPhone
>
> On Feb 11, 2019, at 1:59 PM, Raymond Chen <raymondchen625 at gmail.com>
> wrote:
>
> That happened to my SD card a lot when my Pi served WordPress.
> Does your hard drive have to connect to the PI directly? If your router
> supports network storage, connecting your hard drive to it and mount it
> through SMB is another option.
>
>
> On Mon, Feb 11, 2019 at 5:57 AM Charles M <chaslinux at gmail.com> wrote:
>
>> What if you connect the HD ro a powered USB hub and then connect the hub
>> to the Pi? Yes it adds more wires, but should solve the voltage issues.
>>
>> Otherwise saw those cheap Kingston 120GB SSDs for a crazy $27.99 at CC
>> with lots in stock.
>>
>> On Sun, Feb 10, 2019 at 6:42 PM Khalid Baheyeldin <kb at 2bits.com> wrote:
>>
>>> I am looking to replace the SD card in the Pi with an external USB hard
>>> drive, because
>>> of how using the SD card as the regular filesystem, kills it quick if
>>> the Raspberry Pi is busy.
>>>
>>> The disk in question is a 2.5" HDD in an unpowered SATA to USB
>>> enclosure.
>>>
>>> What is on the web is that the Raspberry Pi does not provide enough
>>> current to power on
>>> regular hard drives. One overcomes this by having the following line in
>>> /boot/config.txt:
>>>
>>> max_usb_current=1
>>>
>>> And now the Pi will provide enough current for some disks to work.
>>>
>>> I plugged in the 2.5" USB disk into an old Pi 2, and I got this:
>>>
>>> [1915663.656110] *Under-voltage detected!* (0x00050005)
>>> [1915665.896054] usb 1-1.2: new high-speed USB device number 6 using
>>> dwc_otg
>>> [1915666.027408] usb 1-1.2: New USB device found, idVendor=152d,
>>> idProduct=0539
>>> [1915666.027426] usb 1-1.2: New USB device strings: Mfr=10, Product=11,
>>> SerialNumber=3
>>> [1915666.027437] usb 1-1.2: Product: USB to ATA/ATAPI Bridge
>>> [1915666.027448] usb 1-1.2: Manufacturer: JMicron
>>> [1915666.027458] usb 1-1.2: SerialNumber: 00A1234568BF
>>> [1915666.028810] usb-storage 1-1.2:1.0: USB Mass Storage device detected
>>> [1915666.034242] scsi host0: usb-storage 1-1.2:1.0
>>> [1915667.097004] scsi 0:0:0:0: Direct-Access     FUJITSU  zzzzz
>>> 0100 PQ: 0 ANSI: 6
>>> [1915667.098779] sd 0:0:0:0: [sda] 488397168 512-byte logical blocks:
>>> (250 GB/233 GiB)
>>> [1915667.099523] sd 0:0:0:0: [sda] Write Protect is off
>>> [1915667.099542] sd 0:0:0:0: [sda] Mode Sense: 67 00 10 08
>>> [1915667.100531] sd 0:0:0:0: [sda] Write cache: enabled, read cache:
>>> enabled, supports DPO and FUA
>>> [1915667.126638] sd 0:0:0:0: Attached scsi generic sg0 type 0
>>> [1915667.167254]  sda: sda1 sda2 < sda5 >
>>> [1915667.171010] sd 0:0:0:0: [sda] Attached SCSI disk
>>> [1915669.896159] *Voltage normalised* (0x00000000)
>>> [1915765.621420]  sda: sda1 sda2 < sda5 >
>>> [1915802.971527] EXT4-fs (sda1): mounted filesystem with ordered data
>>> mode. Opts: (null)
>>>
>>> I was able to mount filesystems from the hard disk, even without the
>>> above max current parameter.
>>> So, it seems that this step is not necessary anymore.
>>>
>>> But then I saw these in dmesg:
>>>
>>> [1919494.831934] usb 1-1.2: reset high-speed USB device number 72 using
>>> dwc_otg
>>> [1919499.991904] usb 1-1.2: device descriptor read/64, error -110
>>> [1919515.351869] usb 1-1.2: device descriptor read/64, error -110
>>> [1919515.571861] usb 1-1.2: reset high-speed USB device number 72 using
>>> dwc_otg
>>> [1919520.711888] usb 1-1.2: device descriptor read/64, error -110
>>> [1919536.071810] usb 1-1.2: device descriptor read/64, error -110
>>> [1919536.291810] usb 1-1.2: reset high-speed USB device number 72 using
>>> dwc_otg
>>> [1919546.831810] usb 1-1.2: device not accepting address 72, error -110
>>> [1919546.931778] usb 1-1.2: reset high-speed USB device number 72 using
>>> dwc_otg
>>> [1919557.471762] usb 1-1.2: device not accepting address 72, error -110
>>> [1919557.472224] usb 1-1.2: USB disconnect, device number 72
>>> [1919557.490276] sd 1:0:0:0: [sdb] Synchronizing SCSI cache
>>> [1919557.492644] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result:
>>> hostbyte=0x01 driverbyte=0x00
>>> [1919557.492687] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x28 28 00 1c 9c b8
>>> 00 00 00 08 00
>>> [1919557.492703] print_req_error: I/O error, dev sdb, sector 480032768
>>> [1919557.492841] sd 1:0:0:0: [sdb] tag#0 UNKNOWN(0x2003) Result:
>>> hostbyte=0x01 driverbyte=0x00
>>> [1919557.492863] sd 1:0:0:0: [sdb] tag#0 CDB: opcode=0x28 28 00 00 00 08
>>> 18 00 00 08 00
>>> [1919557.492874] print_req_error: I/O error, dev sdb, sector 2072
>>> [1919557.492916] blk_partition_remap: fail for partition 5
>>> [1919557.492936] Buffer I/O error on dev sdb5, logical block 256, async
>>> page read
>>> [1919557.493019] blk_partition_remap: fail for partition 1
>>> [1919557.493032] Buffer I/O error on dev sdb1, logical block 3, async
>>> page read
>>> [1919557.495651] sd 1:0:0:0: [sdb] Synchronize Cache(10) failed: Result:
>>> hostbyte=0x01 driverbyte=0x00
>>> [1919557.741765] usb 1-1.2: new high-speed USB device number 73 using
>>> dwc_otg
>>> [1919562.871741] usb 1-1.2: device descriptor read/64, error -110
>>> [1919578.231704] usb 1-1.2: device descriptor read/64, error -110
>>> [1919578.451696] usb 1-1.2: new high-speed USB device number 74 using
>>> dwc_otg
>>> [1919583.591696] usb 1-1.2: device descriptor read/64, error -110
>>>
>>> Perhaps power saving on the USB ports or by the enclosure's electronics?
>>>
>>> The other thing is telling the Pi to boot from that USB disk. This
>>> requires adding this line to config.txt
>>> while still running from the SD card:
>>>
>>> program_usb_boot_mode=1
>>>
>>> Then rebooting, and the Pi should boot from the hard disk.
>>>
>>> However, this is not the whole story.
>>>
>>> I always installed Raspian on the Pi's using NOOBS. You download a .zip
>>> file, extract it to an SD
>>> card that is formatted as vfat, and off you go. Very easy.
>>>
>>> Eventually, I want to copy the running system's SD card to the hard disk
>>> to continue from where
>>> it is now.
>>>
>>> I could not find information on how to install Raspian (or NOOBS) to a
>>> hard disk, nor how to have
>>> the disk partition properly for Raspbian.
>>>
>>> For example, in this article
>>> <https://www.maketecheasier.com/boot-up-raspberry-pi-3-external-hard-disk/>,
>>> the author walks through the steps of copying the existing running SD
>>> card to the hard disk, but he copies to /dev/sda (the entire disk, not a
>>> specific partition on it).
>>>
>>> So questions:
>>>
>>> 1. How do I install NOOBS to the hard disk? Do I just format it as vfat
>>> and copy the contents of
>>> the NOOBS zip to it?
>>>
>>> 2. How to partition the hard disk for Raspbian?
>>>
>>> 3. How to make sure that power saving mode would not affect the USB disk?
>>>
>>> --
>>> Khalid M. Baheyeldin
>>>
>>> _______________________________________________
>>> kwlug-disc mailing list
>>> kwlug-disc at kwlug.org
>>> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>>>
>> --
>> Charles McColm
>> Computer Recycling: http://www.comprec.org
>> Fasteroids: http://www.fasteroids.ca
>> Twitter/Identica/Google+: @chaslinux
>> _______________________________________________
>> kwlug-disc mailing list
>> kwlug-disc at kwlug.org
>> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20190211/822b9721/attachment.htm>


More information about the kwlug-disc mailing list