How to setup File Server with Raspberry Pi

We are gonna kick off with preparing fresh copy of Raspberry PI OS Lite on empty SD card with Raspberry Pi Imager software. When is all done SD card has to be removed and inserted back into card reader so Windows can see newly created partition. In my case i’m using Notepadd++ to create empty file called “SSH” without file extension and we are gonna save it to boot partition of our SD card.

Because SSH is enabled with placing empty file called SSH in root partition of SD card, we do not need to connect Monitor, Keyboard and  Mouse to our Raspberry Pi. We are gonna be using SSH connection from another computer or even from another Raspberry Pi. From Windows computer we can use PuTTY software and from Linux computer we can to simply from terminal window.
Before we power on our Raspberry Pi, we need to insert SD card into Raspberry Pi,  connect LAN cable to network Router, connect USB hard drive and we are ready to power up Raspberry Pi.
Next step is to find out IP address of our future File Server. Because we didn’t connect monitor to our File Server, the best way to find it is to login into Router and from there read IP address of our File Server.
I’m using Linux terminal for connection to server, but once you are connected commands are the same from Linux or Windows.
To connect from Windows, we need to open the PuTTY software, enter IP address of our File Server and click on Open button.
In the next Window we need to enter valid username and password. Default username for Raspberry Pi OS is “pi” and password “raspberry”.
For Linux computer we need to just open terminal and enter command:
sudo ssh pi@IP_Address
and when asked enter valid password and we are connected. Now we are ready to make necessary changes to our File Server system and install necessary software.
So let’s get started, first we are gonna open raspi config software by typing:

    sudo raspi-config

First option is to change password for “pi” user, so here we can set desired password. Next under Network Options we are gonna change default hostname to our needs, i personally like to change it to “FileServer”.
After changing Hostname, raspi-config software is gonna ask to reboot our new File Server.
In next step we have to login an update our Raspberry Pi OS on our FileServer, so to do that we are gonna enter next two command:
sudo apt update
sudo apt upgrade
Create folder for mounting our USB drive:
sudo mkdir -m 1777 /media/USB_Drive
Edit “fstab” file and add mount point for our USB Drive:
sudo nano /etc/fstab
Add at end of file next line for ntfs formated hard drive:
/dev/sda1    /media/USB_Drive    ntfs    defaults    0    1
Save changes and mount partition with next command:
sudo mount -a
Install samba server:
sudo apt install samba samba-common-bin
Edit samba config and add our share at end of file:

sudo nano /etc/samba/smb.conf

[Network share]

  comment = Network shared folder

       path = /media/USB_Drive
       browseable = yes
       writable = yes
       only guest = no
       create mask = 0777
       directory mask = 0777
       public = yes
       guest ok = yes

Add pi user to samba and set password:
sudo smbpasswd -a pi
Restart samba service:
sudo service smbd restart
And with restarting samba service we are ready to open File Manager and browse our FileServer.
So from now on our server is ready to go, even if you turn off Raspberry Pi, everything is starting automatically with booting Raspberry Pi OS.
Thanks for visiting!
Till the next time.

Raspberry Pi 4 Native USB Boot

It has finally arrived, unfortunately in beta but it still works, RPi 4 Native USB Boot. Say goodby to micro SD. I have been using RPi 4 for about four months or a little more, as a personal computer and I am mostly satisfied. Settings “boot” partition on micro SD card and “root” partition on
SD disk, works without any problems. But recently it has been possible to set up RPi 4 to boot directly from a USB drive!
My RPi 4 Setup (RPi 4, 4GB, Samsung SSD 250GB, USB to S-ATA adapter, sertronic RPI4-ARC-FA case with cooler)

First I found a video on Youtube and tried to make it and I failed. Then an article came out on the portal, so I followed the instructions and again I failed. 
Opsss! What is happening? 
I used NOOBS for OS instead of Raspbian (oooo noooo). So I came to the conclusion that Native USB Boot does not work on NOOBS.
The following is a step-by-step guide on how to set up RPi 4 for Native USB Boot, or to Boot without micro SD.
So let’s get started:
  1. make a fresh copy of micro SD with Raspbian OS (Raspbian Imager, works on Windows, Linux and macOS)
  2. insert micro SD into RPi4 and power on
  3. install OS
  4. update OS:
    • sudo apt update
    • sudo apt full-upgrade
    • sudo rpi-update
  5. reboot RPi
  6. edit rpi-eeprom-update:
    • sudo nano /etc/default/rpi-eeprom-update
    • FIRMWARE_RELEASE_STATUS value from “critical” to “beta”
  7. update firmware:
    • sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2020-05-15.bin
  8. reboot RPi
  9. check firmware version:
    • vcgencmd bootloader_version
  10. clone micro SD to USB Drive (SD Card Copier)
  11. shutdown RPi
  12. remove micro SD
  13. power on RPi
And that should be it, now we have an RPi with an SSD that is significantly faster than a micro SD. Lots of fun and I hope this step by step guide is helpful.
Until next time, Thanks for visiting!