Showing posts with label Rasbian. Show all posts
Showing posts with label Rasbian. Show all posts

Thursday, April 9, 2020

Rasbian/NOOBS Install

Requirements:

  • Raspberry Pi
  • Power Supply (2.5 amp recommended)
  • Micro SD Card (8GB min.)
    • Raspberry Pi Zero, Zero W, A+, B+, Raspberry Pi 2, Raspberry Pi 3, 3B+ and Raspberry Pi 4 you’ll need a micro SD card.  Others use a standard size SD Card.
  • Keyboard/Mouse
    • I use the following for simplicity as it provides a wireless keyboard and mouse combo.

Canakit Wireless Keyboard w/ Touch Pad for Raspberry Pi- Click to Enlarge

Download

Use an SD card with a minimum capacity of 8GB.
  1. Using a computer with an SD card reader, visit the Downloads page.
  2. Click on NOOBS, then click on the Download ZIP button under ‘NOOBS (offline and network install)’, and select a folder to save it to.
  3. Extract the files from the zip.

Format your SD card

It is best to format your SD card before copying the NOOBS files onto it. To do this:
  1. Visit the SD Association’s website and download SD Formatter 4.0 for either Windows or Mac.
  2. Follow the instructions to install the software.
  3. Insert your SD card into the computer or laptop’s SD card reader and make a note of the drive letter allocated to it, e.g. G:/
  4. In SD Formatter, select the drive letter for your SD card and format it.

Drag and drop NOOBS files

  1. Once your SD card has been formatted, drag all the files in the extracted NOOBS folder and drop them onto the SD card drive.
  2. The necessary files will then be transferred to your SD card.
  3. When this process has finished, safely remove the SD card and insert it into your Raspberry Pi.

First boot

  1. Plugin your keyboard, mouse, and monitor cables.
  2. Now plug the USB power cable into your Raspberry Pi.
  3. Your Raspberry Pi will boot, and a window will appear with a list of different operating systems that you can install. 
    •  Tick the box next to Raspbian and click on Install.
  4. Raspbian will then run through its installation process. Note that this can take a while.
  5. When the install process has completed, the Raspberry Pi configuration menu (raspi-config) will load. Here you are able to set the time and date for your region, enable a Raspberry Pi camera board, or even create users. You can exit this menu by using Tab on your keyboard to move to Finish.

Logging in and accessing the graphical user interface

The default login for Raspbian is username pi with the password raspberryNote that you will not see any writing appear when you type the password. This is a security feature in Linux.

Sunday, June 16, 2019

How to Expand a Linux Partition - Command Line Style

I have several small images of Rasbian and OSMC that are heavily modified that I have wanted to install on larger SD cards.  This is the process that I've followed that appears to work without issue from the command line.


  • Image SD Card with your favorite tool (I've been using ApplePie Baker)
  • See Option 1 and Option 2 below.  Option 2 represents what my SD card experience has been with OSMC.
    • Basically - fdisk -l to identify partition(s).  Delete the partition (or second one if it shows two) and note the start block!  Create a new partition and start it with the exact block of the previous one.  If you want to use the rest of the SD card (like I did) you can use the default end block.  Write and exit.   Reboot - space has not been allocated for use yet...run the command "resize2fs /dev/mmcblk0p..." as root and it will allocate the space.
_________________________________________________________

Option 1



Expand partition and filesystem
List existing devices and partitions with sudo fdisk -l
    $ sudo fdisk -l
    Disk /dev/mmcblk0: 7861 MB, 7861174272 bytes
    4 heads, 16 sectors/track, 239904 cylinders, total 15353856 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0002c262

    Device Boot      Start         End      Blocks   Id  System
    /dev/sda1            8192      122879       57344    c  W95 FAT32 (LBA)
    /dev/sda2          122880     5785599     2831360   83  Linux
Partition to resize is /dev/sda2 make note of Start (122880)
Now run this command:
sudo fdisk /dev/sda
At the prompt (Command (m for help):) type the next letters and then press enter after each:
p
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0002c262

    Device Boot      Start         End      Blocks   Id  System
    /dev/sda1            8192      122879       57344    c  W95 FAT32 (LBA)
    /dev/sda2          122880     5785599     2831360   83  Linux
d delete partition
2 partition to delete i.e /dev/sda2
p to confirm the deletion
n new partition (default)
p primary (default)
2 partition number (default)
122880 first sector as noted above (N.B. not default)
+50G last sector make size 50Gb (N.B. not default) or take default to use the remainder of the disk
p to confirm new partition is created
w writes the partition information, reboot required if the partition was already mounted (as it was in this instance)
After exit, run:
sudo resize2fs /dev/sda2 to expand the file system to fill the new partition

____________________________________________________________________
Option 2
run sudo fdisk /dev/mmcblk0

Then press the keys in order: 
d 2 to delete,
n p 2 Enter Enter to re-create.

Verify the prompts to make sure what you are entering is sensible.

Reboot and enter:-

sudo resize2fs /dev/mmcblk0p2
This is similar to the other answer, but using Pi partition names.
There is one thing to be wary of. MAKE SURE the new partition STARTS on the same block! If it tries to create a new partition in the spare 3M you will need to manually enter start block. Running sudo fdisk -l /dev/mmcblk0 BEFORE will list existing partitions.
Disk /dev/mmcblk0: 14.5 GiB, 15523119104 bytes, 30318592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6d9a0006

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk0p1       8192    93814    85623 41.8M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      94208 30318591 30224384 14.4G 83 Linux