Showing posts with label raspberry pi. Show all posts
Showing posts with label raspberry pi. Show all posts

Thursday, October 14, 2021

Raspberry Pi Model B: Setup Raspbian Wheezy SD Card using Debian Bullseye PC

 

Raspberry Pi (c)2011.12 is very old and slow machine. I decided to reinstall the OS using legacy one, i.e. Wheezy version (End of Support).

On Debian Bullseye PC

Download Raspbian Wheey image from http://downloads.raspberrypi.org/raspbian/images/raspbian-2015-05-07/
and extract it

$ unzip 2015-05-05-raspbian-wheezy.zip

Insert SD Card and check SD Card

# dmesg
...
[ 2554.400733] usb 2-2: Product: Mass Storage Device
[ 2554.400740] usb 2-2: Manufacturer: Generic
[ 2554.400746] usb 2-2: SerialNumber: 058F63666433
[ 2554.402183] usb-storage 2-2:1.0: USB Mass Storage device detected
[ 2554.402877] scsi host1: usb-storage 2-2:1.0
[ 2555.552033] scsi 1:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
[ 2555.553827] scsi 1:0:0:0: Attached scsi generic sg1 type 0
[ 2556.192885] sd 1:0:0:0: [sdb] 15523840 512-byte logical blocks: (7.95 GB/7.40 GiB)
[ 2556.197840] sd 1:0:0:0: [sdb] Write Protect is off
[ 2556.197858] sd 1:0:0:0: [sdb] Mode Sense: 03 00 00 00

The SD Card is at sdb

Warning: Careful to select disk, this command will erase all of your data in sdb.

# umount /dev/sdb
umount: /dev/sdb: not mounted.
# dd bs=4M if=/home/dedetok/master/raspbian/2015-05-05-raspbian-wheezy.img of=/dev/sdb status=progress

On Raspberry Pi Model B

Insert your SD Card into Raspberry Pi Model B, mouse, keyboard, HDMI/TV and Power your Raspberry. Running and configuring Raspbery Pi 2 Model B for the first time will show these menu

1. Expand File System
2. Change User Password
3. Enable Boot to Desktop/Scratch
4. International Options
5. ....

You need to:

  1. Expand File System option 1
  2. Change user (default user is pi) password option 2
  3. Change boot to desktop if you wish option 3

You can alter this configuring later by running

$ sudo raspi-config

Raspbian Wheezy support has been terminated and repository was moved to legacy http://legacy.raspbian.org/. To update your Raspbian Wheezy you need to:

  1. edit /etc/apt/sources.list
    deb http://legacy.raspbian.org/raspbian wheezy main contrib non-free rpi
    #deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
    # Uncomment line below then 'apt-get update' to enable 'apt-get source'
    #deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi
  2. edit /etc/apt/sources.list.d/raspi.list
    #deb http://archive.raspberrypi.org/debian/ wheezy main
    # Uncomment line below then 'apt-get update' to enable 'apt-get source'
    #deb-src http://archive.raspberrypi.org/debian/ wheezy main
  3. edit /etc/apt/sources.list.d/collabora.list
    #deb http://raspberrypi.collabora.com wheezy rpi

You need to download and install legacy repository public key for raspbian wheezy

$ wget http://legacy.raspbian.org/raspbian.public.key
$ sudo apt-key add ./raspbian.public.key
OK

To update your system run:

$ sudo apt-get update
$ sudo apt-get upgrade -y

By default, root user is disable. To enable root and login as root

$ sudo passwd root
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
$ su -
Password:
#

You do not need to type sudo for manage your system. After that you don't need monitor, keyboard and mouse, you can ssh your Raspberry Pi.

Note: By Default SSH Server is enable and running after boot

Running on:

  • Raspberry Pi (c)2011.12 Model B+ Revision 1.0
  • SD Card 8Gb

Thursday, February 8, 2018

How to install Raspbian Stretch to SD Card for Raspberry-pi using Windows (bonus how to unlock SD Card using Windows)

You need to download Raspbian Stretch from https://www.raspberrypi.org/downloads/
File 2017-11-29-raspbian-stretch.zip size: 1.64 GB (1,764,972,666 bytes)

Extract it.
File 2017-11-29-raspbian-stretch.img size: 4.58 GB (4,919,918,592 bytes)

Download and install Win32 Disk Imager from https://sourceforge.net/projects/win32diskimager/. 

Step to write your Raspbian Stretch image into SD Card:

  1. Put your SD Card into slot and run Win 32 Disk Imager.
  2. Select image files and point device to your SD Card.
  3. Click Write and wait until it finish. It will take some times, the image size is big :).

It takes 5-10 minues on my PC.

In case your SD Card state Write Protect or something like that, and you are sure that your SD Card switch is Unlock please follow these to unlock your SD Card (bonus): 
Caution: Use with your own risk! These instructions below may destroy your existing system/data on your hard drive if not careful.
A. Remove SD Card protection policy by running regedit

  1. Open Computer -> HKEY_LOCAL_MACHINE -> System -> Current Control Set -> Control
  2. Create (if not exist) or edit Storage Device Policies to DWORD (32 bit) Value to 0
  3. Restart your windows 

B. Unlock and remove any partition on SD Card

  1. Run diskpart
    Microsoft DiskPart version 10.0.16299.15
    Copyright (C) Microsoft Corporation.
    On computer: DEDET2013
  2. List your disk (CAUTION: Please read/select your disk carefully otherwise you may remove partition on your hard drive)
    DISKPART> list disk
      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 0    Online          465 GB   451 MB        *
      Disk 1    Online         7580 MB  3072 KB
  3. Choose/select your sd card
    DISKPART> select disk 1
    Disk 1 is now the selected disk.
    DISKPART> list disk
      Disk ###  Status         Size     Free     Dyn  Gpt
      --------  -------------  -------  -------  ---  ---
      Disk 0    Online          465 GB   451 MB        *
    * Disk 1    Online         7580 MB  3072 KB
  4. It will mark * for selected disk, now you can unlock and remove any partition on selected disk.
    DISKPART> clean
    DiskPart succeeded in cleaning the disk.
  5. Exit diskpart by type exit command
    DISKPART> exit

Running Raspberry Stretch for first time:
  1. Default user is pi with password raspberry, to change default password for pi user:
    $ passwd 
  2. Set password for root:
    $ sudo passwd root
References: 

  • https://www.raspberrypi.org/documentation/installation/installing-images/ 
  • https://www.raspberrypi.org/documentation/installation/installing-images/windows.md 
  • https://www.easeus.com/storage-media-recovery/remove-write-protection-in-windows-10-8-7.html 


Tuesday, July 7, 2015

How to install Raspbian Wheezy to SD Card for Raspberry-pi using Debian Machine

Raspberry-pi is a community product for System On Chip (SOC). It's uses ARM Processor with low power usage. We can say, it's absolutely green computing. Unfortunately, the performance was poor, may be we can find more powerful 4, 6 or 8 core ARM with low power usage. 
This is how I install raspbian on raspberry-pi:
  1. Download raspbian form official site http://www.raspberrypi.org/downloads/
  2. From Debian open terminal as a root privilage
  3. If you dont't have image writer to SD-Card, install this pacakge first # apt-get install dcfldd
  4. Insert your SD-Card and find out where it's mounted by your Debian
    # dmesg
    [  995.384415] mmc0: new high speed SDHC card at address aaaa
    [  995.384943] mmcblk0: mmc0:aaaa SU08G 7.40 GiB
    [  995.390744]  mmcblk0: p1
  5. Unmount SD Card
    # umount /dev/mmcblk0
    umount: /dev/mmcblk0: not mounted
  6. Copy your Raspbian image into SD Card
    # dcfldd bs=4M if=[folder_input_file]/2013-09-25-wheezy-raspbian.img of=/dev/mmcblk0
  7. Make sure the SD-Card is writen properly
    # sync

Note:
Copying image may take a long time, it's size up to 2.96Gigabyte