We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

RestoModPi
Posts: 9
Joined: Fri Feb 04, 2022 12:35 pm

Loading Ubuntu on a new Pi, with SSD

Sat Feb 19, 2022 7:37 pm

If I obtain a Pi 4B along with a SATA SSD, is the basic idea to install the OS (I'd use Ubuntu from a bootable USB stick) on the SSD? Meaning, once the OS is installed the system would boot and run entirely from the SSD and the SD card wouldn't be needed for operation.

That'll work with the Pi, correct?

drgeoff
Posts: 14413
Joined: Wed Jan 25, 2012 6:39 pm

Re: Loading Ubuntu on a new Pi, with SSD

Sat Feb 19, 2022 7:47 pm

1. No model of RPi has a SATA interface. A USB-SATA interface is the usual solution.

2. Use any of the usual image writing tools to install the Ubuntu OS image directly to the SSD. Note that you need an image specifically intended for a RPi. See https://www.raspberrypi.com/software/
Quis custodiet ipsos custodes?

RestoModPi
Posts: 9
Joined: Fri Feb 04, 2022 12:35 pm

Re: Loading Ubuntu on a new Pi, with SSD

Sat Feb 19, 2022 7:51 pm

Thanks, good news on the imager.

Yeah, I should have said I'd use a SATA to USB cable. I assume plugging it into a USB 3.0 port is much better than a 2.0, or will it not make any difference since I'd be using that adapter cable?

The drive I'm looking at is a Crucial 500GB.

bjtheone
Posts: 3353
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Loading Ubuntu on a new Pi, with SSD

Sat Feb 19, 2022 9:19 pm

USB 3.0 will perform much better. Check the power requirements of your SSD. Some are rather power hungry and requires a powered USB hub or an enclosure that supports external power. Some would just fine "direct connected/powered". I run my desktops from Kingston A400 128 GB units.

RestoModPi
Posts: 9
Joined: Fri Feb 04, 2022 12:35 pm

Re: Loading Ubuntu on a new Pi, with SSD

Sat Feb 19, 2022 10:02 pm

Should I just go with Raspbian and forget about Ubuntu? My experience is with Ubuntu, but if native Raspbian is as good or better I'd be happy going that direction.

User avatar
HawaiianPi
Posts: 7918
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Loading Ubuntu on a new Pi, with SSD

Sat Feb 19, 2022 10:07 pm

The very early version of the Pi 4B did not have USB-boot compatible firmware, however, it's highly unlikely any of those are still in the retail supply chain, so if you are purchasing a new 4B it should come with newer firmware pre-installed. If you are getting a used one, it may need updating (which will require an SD card).

Booting a 4B from USB 3.0 requires a compatible USB-SATA adapter. Users here have had good luck with adapters that use ASMedia chips, while many of the common ones with JMicron chips have been problematic with Linux and the 4B. So choose your USB 3.0 adapter cable or enclosure carefully to avoid that issue. The ones I use have ASM1153E chips and work great with the 4B running RPiOS or Ubuntu.

I have one 4B running Ubuntu Server that is booting from an SSD and I had no trouble just writing that image to the SSD and booting the server, completely headless (no keyboard, mouse, monitor or SD card needed).

It's even easier with Raspberry Pi OS because Raspberry Pi Imager's Advance options allow you to pre-configure many common settings, such as SSH login, password, wireless network and others. You can access Advanced options by clicking on the gear button or with Control + Shift + x.

Performance from a SATA SSD will be more than an order of magnitude faster than an SD card. Even an inexpensive "Budget" class SSD will be much faster than a more expensive, premium SD card. Look for an SSD that can run on less than 5 watts (many SATA models will, but some are shockingly power hungry). The USB power limit on the Pi 4B is 6 watts (5V, 1.2A), shared by all four USB-A ports.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

User avatar
kerry_s
Posts: 8430
Joined: Thu Jan 30, 2020 7:14 pm

Re: Loading Ubuntu on a new Pi, with SSD

Sat Feb 19, 2022 11:09 pm

RestoModPi wrote:
Sat Feb 19, 2022 10:02 pm
Should I just go with Raspbian and forget about Ubuntu? My experience is with Ubuntu, but if native Raspbian is as good or better I'd be happy going that direction.
why pick, you can go with both. it's very easy to swap and boot another os.
just grab a few usb3 flash drives.

i keep several drives, i have raspberry and i use the others to play around with other os's.

raspberry os is always going to be the best because it's purpose built.
other os's run, but they just added the extra parts need to boot on a pi, they are not optimized at all.

for example ubuntu works, is fairly quick, but there is no video hardware acceleration, so you'll see high cpu use & temps because of the lack of gpu decode.
it's not a problem in most cases as it will still do what you want to do.

i use raspberry more for when i want to watch lots of videos/movies/tv, etc....

but if i'm just bouncing around the web, watching youtube here & there, i'll usually swap to something else.

today i'm on ubuntu.
Attachments
Screenshot from 2022-02-19 13-06-31.png
Screenshot from 2022-02-19 13-06-31.png (106.72 KiB) Viewed 4652 times
Screenshot from 2022-02-19 13-07-58.png
Screenshot from 2022-02-19 13-07-58.png (57.9 KiB) Viewed 4652 times

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 15292
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Loading Ubuntu on a new Pi, with SSD

Sun Feb 20, 2022 1:53 pm

please don't post questions about ubuntu in the regular (raspberry PI OS) section, it confuses our regular readers, write NON Raspberry PI OS questions in the "other OS" section, or in the OS you are using if there is one section.

RestoModPi
Posts: 9
Joined: Fri Feb 04, 2022 12:35 pm

Re: Loading Ubuntu on a new Pi, with SSD

Sun Feb 20, 2022 1:57 pm

mahjongg wrote:
Sun Feb 20, 2022 1:53 pm
please don't post questions about ubuntu in the regular (raspberry PI OS) section, it confuses our regular readers, write NON Raspberry PI OS questions in the "other OS" section, or in the OS you are using if there is one section.
Understood. Thank you for the info, I'll remember it.

User avatar
RasPiGaming
Posts: 408
Joined: Mon Jul 26, 2021 1:06 pm

Re: Loading Ubuntu on a new Pi, with SSD

Sun Feb 20, 2022 6:30 pm

I use the Silicon Power A55 SSD. Pretty cheap and works quite well with the Pi4, running Ubuntu Desktop 21.04.
An RPi can be a gaming PC. As long as you have the right packages and software anyway.
Using a RPi4 8GB with Ubuntu Desktop 21.04, main interests are gaming and programming. Also occasionally uses two RPi3B+ and a RPi3B.

shamael
Posts: 52
Joined: Fri Sep 10, 2021 2:09 pm

Re: Loading Ubuntu on a new Pi, with SSD

Mon Feb 21, 2022 11:03 am

I run Ubuntu 21.10 on SSD with another dedicated storage (NAS/seedbox). The setup is headless with RealVNC

Sticking with ASMEDIA USB to SATA controller for the SSD and HDD housing, here was my shopping list if it may help
#SSD for Ubuntu
https://www.amazon.fr/gp/product/B07GMD ... =UTF8&th=1
#Housing for the SSD
https://www.amazon.fr/gp/product/B016HL ... UTF8&psc=1
#HDD housing (for 3.5 HDD)
https://www.amazon.fr/UGREEN-Bo%C3%AEti ... sr=8-5#Ask

blade777
Posts: 75
Joined: Thu Oct 29, 2020 2:49 am

Re: Loading Ubuntu on a new Pi, with SSD

Mon Feb 21, 2022 11:08 am

if you want fastest performance out of any usb hdd sata bridge put it into the cmd file use storage quirks i have many refs on the forum here ..i mostly do ubuntu...hence my posts here..m-2s are the fastest m-2 black wds are good or evos etc the faster the driuve perforance the quicker obsly.. hence those with built on sinks are the fastest....put the hdd in the freezer and do a massive data move cutting it of one onto another see the difference in performance....!!!!..

blade777
Posts: 75
Joined: Thu Oct 29, 2020 2:49 am

Re: Loading Ubuntu on a new Pi, with SSD

Mon Feb 21, 2022 11:14 am

use a high quality spinner..???wd-black for data storage...a nas spinner is faster and better quality..only real diff...keep it cold..ifits a ram hdd if its a spinner glue sinks on it big finned ones..and just sit them on the bench..lol if you want neatness... forget about performance and good looks..unless you got lots to spend......

User avatar
HawaiianPi
Posts: 7918
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Loading Ubuntu on a new Pi, with SSD

Mon Feb 21, 2022 12:20 pm

blade777 wrote:
Mon Feb 21, 2022 11:08 am
if you want fastest performance out of any usb hdd sata bridge put it into the cmd file use storage quirks
That is incorrect information.

USB storage quirks are only needed if the USB-SATA adapter has bad or incomplete UASP support. Adding quirks disables UAS and uses mass storage protocol, which is slower (but faster than a non-working adapter).

Quirks are not needed for a properly working USB 3.0 adapter cable or enclosure.

blade777 wrote:
Mon Feb 21, 2022 11:08 am
m-2s are the fastest m-2 black wds are good...
Also incorrect.

First of all, M.2 is just a form-factor, and it supports different protocols (SATA, PCIe AHCI or NVMe). For use on a Pi4B neither the form factor or interface matters, because they all require a USB 3.0 adapter, and talk to the SoC over a single PCIe V2 lane with 4Gbps bandwidth, which is slower than SATA (6Gbps) and even USB 3.0 (5Gbps).

So a WD Black M.2 NVMe drive on a Pi4B will just consume more power and run hotter without offering better performance (when compared to a less expensive and cooler running SATA-SSD).

On a CM4 with an NVMe I/O board it would be slightly faster (but not by much, as it's still massively bottlenecked by the single V2 PCIe lane).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?

blade777
Posts: 75
Joined: Thu Oct 29, 2020 2:49 am

Re: Loading Ubuntu on a new Pi, with SSD

Mon Feb 21, 2022 1:04 pm

i cannot help my self a i guess i guess does rpi use commandl ine code or boot order to attain irqs for devices..??? i am curious..???

EDIT its always the sata bridge that is the bottle neck no matter how fast the device is behind it...most of all is the usb bottle neck
Last edited by blade777 on Mon Feb 21, 2022 1:39 pm, edited 2 times in total.

blade777
Posts: 75
Joined: Thu Oct 29, 2020 2:49 am

Re: Loading Ubuntu on a new Pi, with SSD

Mon Feb 21, 2022 1:22 pm

is scsi faster than m-2...???or does m-2 emulate scsi or is it the equivalent in r-w cycles

blade777
Posts: 75
Joined: Thu Oct 29, 2020 2:49 am

Re: Loading Ubuntu on a new Pi, with SSD

Tue Feb 22, 2022 2:07 am

if i may have an op on the next gen rpi-5 pc.b. would be an optical audio SPDIF OUTPUT.. socket on topside and an m-2 triple key socket header on the underside of the ..p.c.b..

blade777
Posts: 75
Joined: Thu Oct 29, 2020 2:49 am

Re: Loading Ubuntu on a new Pi, with SSD

Tue Feb 22, 2022 2:30 am

NVMe SSD Boot

Edit this on GitHub

NVMe (non-volatile memory express) is a standard for accessing solid state drives (SSDs) via a PCIe bus. You can connect these drives via the PCIe slot on a Compute Module 4 (CM4) IO board, allowing a CM4 to boot from SSD.
Required Hardware

You need an NVMe M.2 SSD. You cannot plug an M.2 SSD directly into the PCIe slot on the IO board - an adaptor is needed. Be careful to get the correct type: a suitable adaptor can be found online by searching for 'PCI-E 3.0 x1 Lane to M.2 NGFF M-Key SSD Nvme PCI Express Adapter Card'.

The latest version of Raspberry Pi OS supports booting from NVMe drives. To check that your NVMe drive is connected correctly, boot Raspberry Pi OS from another drive and run ls -l /dev/nvme*; example output is shown below.

crw------- 1 root root 245, 0 Mar 9 14:58 /dev/nvme0
brw-rw---- 1 root disk 259, 0 Mar 9 14:58 /dev/nvme0n1

If you need to connect the NVMe drive to a PC or Mac you can use a USB adaptor: search for 'NVME PCI-E M-Key Solid State Drive External Enclosure'. The enclosure must support M key SSDs.
Required Software

To boot from NVMe you need a recent version of the bootloader (after July 2021), and a recent version of the VideoCore firmware and Raspberry Pi OS Linux kernel. The latest Raspberry Pi OS release has everything you need, so you can use the Raspberry Pi Imager to install the software to your SSD.
Bootloader

You might need to use rpiboot to update the CM4 bootloader. Instructions for building rpiboot and configuring the IO board to switch the ROM to usbboot mode are in the usbboot Github repository.

Remember to add the NVMe boot mode 6 to BOOT_ORDER in recovery/boot.conf.
Firmware and kernel

You must have the latest versions of the VideoCore firmware and Raspberry Pi OS Linux kernel to boot directly from an NVMe SSD disk. The Raspberry Pi Bullseye and Buster Legacy releases have everything needed.

If you are using CM4 lite, remove the SD card and the board will boot from the NVMe disk. For versions of CM4 with an eMMC, make sure you have set NVMe first in the boot order.
NVMe BOOT_ORDER

This boot behaviour is controlled via the BOOT_ORDER setting in the EEPROM configuration: we have added a new boot mode 6 for NVMe. See Raspberry Pi 4 Bootloader Configuration.

Below is an example of UART output when the bootloader detects the NVMe drive:

Boot mode: SD (01) order f64
Boot mode: USB-MSD (04) order f6
Boot mode: NVME (06) order f
VID 0x144d MN Samsung SSD 970 EVO Plus 250GB
NVME on

It will then find a FAT partition and load start4.elf:

Read start4.elf bytes 2937840 hnd 0x00050287 hash ''

It will then load the kernel and boot the OS:

MESS:00:00:07.096119:0: brfs: File read: /mfs/sd/kernel8.img
MESS:00:00:07.098682:0: Loading 'kernel8.img' to 0x80000 size 0x1441a00
MESS:00:00:07.146055:0:[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]

In Linux the SSD appears as /dev/nvme0 and the "namespace" as /dev/nvme0n1. There will be two partitions /dev/nvme0n1p1 (FAT) and /dev/nvme0n1p2 (EXT4). Use lsblk to check the partition assignments:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 232.9G 0 disk
├─nvme0n1p1 259:1 0 256M 0 part /boot
└─nvme0n1p2 259:2 0 232.6G 0 part /

User avatar
kerry_s
Posts: 8430
Joined: Thu Jan 30, 2020 7:14 pm

Re: Loading Ubuntu on a new Pi, with SSD

Tue Feb 22, 2022 2:36 am

blade777 wrote:
Mon Feb 21, 2022 1:04 pm
i cannot help my self a i guess i guess does rpi use commandl ine code or boot order to attain irqs for devices..??? i am curious..???

EDIT its always the sata bridge that is the bottle neck no matter how fast the device is behind it...most of all is the usb bottle neck
it uses PARTUUID to identify the device
Attachments
2022-02-21-163534_1920x1080_scrot.png
2022-02-21-163534_1920x1080_scrot.png (228.31 KiB) Viewed 4368 times

blade777
Posts: 75
Joined: Thu Oct 29, 2020 2:49 am

Re: Loading Ubuntu on a new Pi, with SSD

Tue Feb 22, 2022 2:53 am

hm intreresting thought it may have been putting something into the fstab to give it a pointer for the storage device...but it also normally does this on a X86 machine under Ubuntu when you load or insert a device ...on the fly but does not always have an fstab entry listed i noticed...???

User avatar
kerry_s
Posts: 8430
Joined: Thu Jan 30, 2020 7:14 pm

Re: Loading Ubuntu on a new Pi, with SSD

Tue Feb 22, 2022 3:10 am

blade777 wrote:
Tue Feb 22, 2022 2:53 am
hm intreresting thought it may have been putting something into the fstab to give it a pointer for the storage device...but it also normally does this on a X86 machine under Ubuntu when you load or insert a device ...on the fly but does not always have an fstab entry listed i noticed...???
yeah, those are temporary. which like windows, will go down the list. sdb, sdc, etc....
dependent on the device usb, sd, etc....

also for some reason, usb speakers shows up as a drive.
Attachments
Screenshot from 2022-02-21 17-09-27.png
Screenshot from 2022-02-21 17-09-27.png (199.13 KiB) Viewed 4339 times

blade777
Posts: 75
Joined: Thu Oct 29, 2020 2:49 am

Re: Loading Ubuntu on a new Pi, with SSD

Tue Feb 22, 2022 3:25 am

thx for that id like to stay and chat more but i have to jett,,back on later though..!!!..may i look u up...??..later..

Return to “Ubuntu”