×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Stupid-simple way to move your SM from SD card to SSD drive (requires Linux-style "dd" command)

  • Posts: 222
  • Thank you received: 20
So I wanted my Pi to boot and run off a nice big SSD. Here's the simplest way I know to make that happen. If you want to clone your existing StellarMate system with all your tweaks and files, you'll need access to the "dd" command, available on Linux, Macs, and Windows machines with a Bash shell or similar installed (e.g., Cygwin). If you just want to install the StellarMate image you bought from Jasem, jump past these first instructions to BURN DISK IMAGE.

CREATE DISK IMAGE
  1. Sadly, you can't use the Linux command line to clone your MicroSD card while you're running from it on the Pi. So power down the Pi, pull the card, and put it into a USB reader attached to another machine. (Although if you've got a spare MicroSD that your Pi can boot from, boot from that, and insert the to-be-cloned card into a USB reader on your Pi!)
  2. From the command line, determine the device name of your card. On my Mac, Balena Etcher reports it as "/dev/disk2", and the "mount" command reports that "/dev/disk2s1" is mounted. "/dev/disk2" is what we want.
  3. Run the dd command. Check at least twice that you have not confused the "if" (input file) and "of" (output file) arguments. Yes, it's possible to toast your computer's file system if you do. "if" should be the device name you figured out in Step 2, and "of" should be a regular file name -- that file will be as big as your card's capacity. You want a 4-megabyte block size. On my Mac, the whole command is:
    sudo dd bs=4194304 if=/dev/disk2 of=/Volumes/home/Downloads/RickStellarMate-1.5.8.img
  4. Now, RickStellarMate-1.5.8.img in my Downloads folder is an image like the one you got from Jasem,  but with all my stuff. Eject the MicroSD card.
BURN DISK IMAGE

It's good to use a program like Balena Etcher for this, since it will do some error-checking for you. With Balena, it's just:
  1. Plug your SSD into a convenient USB port
  2. Run Balena, selecting "Flash from file"
  3. Choose the image file you created above as the source
  4. Choose your SSD as the destination. CAREFUL: It is possible to nuke your system if you pick its hard disk instead of the external. Check that.
  5. Flash!
If you don't have Etcher, you can use the good ol' dd command again. This time, "if" is your image file, and  "of" is your SSD, whose device name you investigate as you did under CREATE DISK IMAGE.  For my Mac:sudo dd bs=4194304 if=/Volumes/home/Downloads/RickStellarMate-1.5.8.img of=/dev/disk2

(Note that I'm using "disk2" again, the system assigned the same device name to the SSD after I unplugged the MicroSD card and plugged in the SSD.)

Note too that this will not only wipe any data on your SSD, it will wipe the file system too, so you can no longer plug it into any computer that doesn't recognize the ext4 Linux file system.

ENJOY SSD
  1. Plug SSD into your Pi, ensuring that you have no MicroSD card
  2. Power up. Zingo bingo!
WAIT, WHERE DID MY BIG DISK GO?!!!

Ah. Yes. That. Well, "dd" created a partition the size of your MicroSD card on the SSD, but if you have a big SSD, a lot of it is going to waste. We need to make a file system "partition" for it, format  the file system with the ext4 filesystem, and graft it onto the tree of folders and files so that you can make use of it. This is a bit more abstruse, but bear with me, it's perfectly straighforward.
  1. If your Pi doesn't already have the Gnome Partition Editor  "gparted" installed, install it: sudo apt install gparted
  2. Run it: sudo gparted
  3. You will see a disk with a bunch of unallocated space. In the case of my 500GB SSD, rather a lot of unallocated space. Right-click that and create a partition, accepting all the default choices, ensuring that it's formatted as "ext4"
  4. Save and exit gparted
Now you've got a partition ready for Linux to use. To make it part of the file hierarchy:

ADD TO SYSTEM FILE TABLE
  1. Make a backup of the system file table: sudo cp /etc/fstab /etc/fstab.bak
  2. Create a folder under which your new storage will live. I made a folder /home/stellarmate/images.
  3. Find the partition-table UUID of the new partition: lsblk -o NAME,SIZE,PARTUUID
  4. Using whatever text editor you like via "sudo", open the file system table: sudo vi /etc/fstab
  5. Duplicate the line with an "ext4" filesystem type named "/".
  6. Edit the new line's PARTUUID portion to be the value you got in step 3.
  7. Edit the "/" portion of the new line to be the folder you created in step 2 (in my case, /home/stellarmate/images).
  8. Change the options portion of the new line (it was "defaults,noatime" for mine)  to "defaults,auto,users,rw,nofail".
  9. Change the 1 at the end of the line to a 0.
So my fstab, when I'm done, looks like:
proc            /proc           proc    defaults          0       0
PARTUUID=d9b3f436-01  /boot           vfat    defaults          0       2
PARTUUID=d9b3f436-02  /               ext4    defaults,noatime  0       1
PARTUUID=d9b3f436-03  /home/stellarmate/images  ext4    defaults,auto,users,rw,nofail    0    0
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

(I mostly used the directions in www.raspberrypi.org/documentation/config.../external-storage.md for this)

Next time you  boot, you'll have oodles of space  on your SSD, and it will appear to be just part of the system.
 
2 years 8 months ago #73064

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

  • Posts: 421
  • Thank you received: 102
I would just make the partition bigger, then expand the filesystem to fill it, using the resize2fs command.

Although I haven't tried this with an SSD, I believe the easiest way to use your entire SSD is to just run the raspi-config command (as root), go to the advanced options menu, then select expand filesystem. This will make the partition fill the entire disk, then expand the filesystem to fill the partition.
2 years 8 months ago #73065

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

  • Posts: 1067
  • Thank you received: 140
@Rick,
that is a really long winded way to put the entire system on an SSD and expand the file system….not stupid simple at all…..but this way is…. :)
just plug the SSD into a USB 3 port on the RPI, use the “SD copy” tool in the Stellarmate or Astroberry menu, this will clone from internal SD card to SSD then as @Kevin says go to raspi-config and use the resize tool and it will fill the SSD drive and all the space will then be available…takes minutes to do the whole thing….
Last edit: 2 years 8 months ago by AstroNerd.
2 years 8 months ago #73083

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

  • Posts: 222
  • Thank you received: 20
Yah, I should just delete this. I almost never look at that screen, hence my idiocy. Would you post that as a separate topic? I'm embarrassed to leave this up but your alternative is valuable information. We know that at least one person really needed to see it. :-)
2 years 8 months ago #73119

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

Time to create page: 0.212 seconds