×

INDI Library v1.9.9 Released (30 Nov 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

Astroberry on USB SSD with microSD fallback

  • Posts: 6
  • Thank you received: 1
I had a 500 GB SSD used as cache on my NAS but the estimated lifespan was going too down so I’ve replaced it.
Now I’m using the SSD in an USB enclosure attached to Raspberry Pi 4 to boot Astroberry, but due to low estimated lifespan (1%), (and because I don’t know where to store the Astroberry microSD without loosing it :) ) I’ve set the microSD as fallback.
Here how I’ve made it.

1) Backup the Astroberry SD from my computer:

Identify the SD volume
diskutil list
save a copy on computer
gzip -dc /Volumes/4TB-Foto/Astrofoto/astroberry2022-04-21.gz | sudo dd of=/dev/disk8s4

2) restore the backup on SSD
with balenaEtcher I selected the backup file and restored on SSD
File Attachment:


3) [optional] additional partition for images
I prefer to keep the images on another partition, so I can easier restore the system on a smaller SD and set selective backup, so I’ve attached the only SSD to USB 3 port, booted and installed gparted on Astorberry.
File Attachment:

I’ve se they astroberry as owner of the new mountpoint
sudo chown -R astroberry:astroberry /media/astroberry/astrofoto/
then I moved the folders ~/Light, ~/Dark, ~/Bias and ~/Flat to the new partition and created symbolic links
ln -s /media/astroberry/astrofoto/Light ~/Light; ln -s /media/astroberry/astrofoto/Dark ~/Dark; ln -s /media/astroberry/astrofoto/Flat ~/Flat; ln -s /media/astroberry/astrofoto/Bias ~/Bias

4) change PARTUUID
I’ve rebooted with SD card and SSD attached but restoring from the backup I’ve got the same PARTUUID, so I can’t define what is the correct partition to mount.
File Attachment:

so, thanks to this guide I changed the PARTUUID:
astroberry@astroberry:~ $ sudo fdisk /dev/sda
 
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
 
Command (m for help): p
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: SSD 860 EVO 500G
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x9efc3dd8
 
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            8192    532479    524288   256M  c W95 FAT32 (LBA)
/dev/sda2          532480 307732479 307200000 146.5G 83 Linux
/dev/sda3       307732480 976773119 669040640   319G 83 Linux
 
Command (m for help): x
 
Expert command (m for help): i
 
Enter the new disk identifier: 0x860e500        
 
Disk identifier changed from 0x9efc3dd8 to 0x0860e500.
 
Expert command (m for help): r
 
Command (m for help): w
The partition table has been altered.
Syncing disks.

so now they are different:
File Attachment:
Last edit: 9 months 6 days ago by Matteo. Reason: Integration
9 months 6 days ago #82570

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 1
5) define the boot order
now I can set the boot order with the command:
sudo raspi-config
chosing Advanced options > Boot Order
File Attachment:


6) set the root PARTUID of SSD
On SSD I can now set the new PARTUUID for root volume:
sudo nano /boot/cmdline.txt
and replace the SD PARTUUID to the SSD PARTUUID:
root=PARTUUID=9efc3dd8-01 root=PARTUUID=0860e500-02

7) define the mount point on SSD
sudo nano /etc/fstab
File Attachment:


Now, rebooting I have this:
astroberry@astroberry:~ $ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 465.8G  0 disk 
├─sda1        8:1    0   256M  0 part /boot
├─sda2        8:2    0 146.5G  0 part /
└─sda3        8:3    0   319G  0 part /media/astroberry/astrofoto
mmcblk0     179:0    0 116.2G  0 disk 
├─mmcblk0p1 179:1    0   256M  0 part /media/astroberry/boot
└─mmcblk0p2 179:2    0 115.9G  0 part /media/astroberry/rootfs
where "sda" is the SSD and "mmcblk0" is the SD.
If I remove the SSD it boots with SD and I have:
astroberry@astroberry:~ $ lsblk 
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0     179:0    0 116.2G  0 disk 
├─mmcblk0p1 179:1    0   256M  0 part /boot
└─mmcblk0p2 179:2    0 115.9G  0 part /


The speed is improved:
with microSD (Kingston SDCG3/128GB Canva Go! Plus)
Raspberry Pi Diagnostics - version 0.9
Sat Apr 23 11:51:42 2022
 
Test : SD Card Speed Test
Run 1
prepare-file;0;0;36187;70
seq-write;0;0;35989;70
rand-4k-write;0;0;8046;2011
rand-4k-read;17151;4287;0;0
Sequential write speed 35989 KB/sec (target 10000) - PASS
Random write speed 2011 IOPS (target 500) - PASS
Random read speed 4287 IOPS (target 1500) - PASS
Test PASS

with SSD (very used Samsung 860 EVO 500GB)
Raspberry Pi Diagnostics - version 0.9
Sat Apr 23 10:32:33 2022
 
Test : SD Card Speed Test
Run 1
prepare-file;0;0;258015;503
seq-write;0;0;257003;501
rand-4k-write;0;0;52809;13202
rand-4k-read;41217;10304;0;0
Sequential write speed 257003 KB/sec (target 10000) - PASS
Random write speed 13202 IOPS (target 500) - PASS
Random read speed 10304 IOPS (target 1500) - PASS
Test PASS
9 months 6 days ago #82571

Please Log in or Create an account to join the conversation.

Moderators: Radek Kaczorek
Time to create page: 0.431 seconds