You are here

RasPBX on Raspberry PI 3B+ loaded on SSD?

9 posts / 0 new
Last post
K1DOS
RasPBX on Raspberry PI 3B+ loaded on SSD?
Is anyone running RasPBX with a PI using an external USB drive?  I would like to move my PBX off of the SD card.

Thanks in advance.

Hank / K1DOS
AA7AU
AA7AU's picture
Years ago I ran several Pis

Years ago I ran several Pis (v1) using USB thumb-drives. Basically what it involves is moving everything off the then SD (now MicroSD) card over to the USB/SSD/whatever except for the /boot partition which is used to start the GPU to then start the real system. Don't remember the exact steps but the concept is pretty clear. The entire idea was to move all read/write off the card to a hopefully faster and more resilient device. The was one edit in the config.txt file which told the GPU where to find the rest of everything, no other changes. Worked well for me for a long time. I'm still using one of those old v1s for my PIHole.

Bottom line: it can be easily done, doesn't take much work just be clear on the copy/move. Sorry I don't have more details or a URL for you. Good luck.

HTH,
- Don - AA7AU

nc8q
nc8q's picture
RPi using an external USB drive?

Hi, Hank

6 of my 7 RPis have a spinning/magnetic USB drive
(USB powered 2.5" HDD). /boot remains on the SD card.
The one without is a WX receiver using a RTL-SDR.

I avoid / (root) and /swap on anything Solid State.
I have read that re-writes on SSDs is very slow, so
/swap on a SSD (and SD card) should be avoided.

Hope this helps.
Chuck

K1DOS
Chuck,
Chuck,

Thanks for the response.  I will buy a new drive.  Can you tell me if you are running RasPBX on one of those PIs?  If so, can you advise how it's done?

Hank

 
nc8q
nc8q's picture
running RasPBX

Hi, Hank:

Yes. I am running RasPBX on a Pi3 Model B.
http://www.raspberry-asterisk.org/downloads/

Chuck

K1DOS
Chuck,
Chuck,

If/when you have time can you share how you got it to work on your external drive?  I have system running now on the SD card.

Hank / K1DOS
nc8q
nc8q's picture
I have system running now on the SD card.

I assume 'system' == raspbx-04-04-2018.

There should be many examples on booting a RPi from an external drive by
using your favorite search tool.

The NOOBS distribution has the option to install to HDD.
Since we are installing an image (raspbx) instead of a 'distribution':
From my memory:

Do an image copy of your SD card to your HDD.
( example: sudo dd if=/dev/mmcblk0 of=/dev/sda status=progress )
Wait for it...
Your HDD will now appear to be of the same size as your SD card.
Edit /boot/cmdline.txt on your SD card.
( /dev/mmcblk0p1/boot/cmdline.txt )

From: dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p# rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
To: dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/sda# rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

Match '#' numbers

Reboot.
Some /dev/mmcblk0p# and/or /dev/sda# should be automatically found and mounted.

/dev/sda#/etc/fstab is still mounting root on /dev/mmcblk0p#

On /dev/sda#, edit /etc/fstab

From: /dev/mmcblk0p# / ext4 defaults,noatime 0 1
To: /dev/sda# / ext4 defaults 0 1

Reboot.

I think this will work. :-|

K1DOS
Chuck,
Chuck,

Thanks for your time an effort.  I have searched the web for a guide on how to achive this but have not found anyting that can walk a non-linux person through the steps (A,B,C, D, 1,2,3,4).  I tried to follow the steps but it did not work (for me).  I could not navigate to /dev/mmcblk0p1/boot/cmdline.txt.  mmcblk0p1 is not a folder on my systems? I did find cmdline.txt in /boot and changed the line to sda1 and saved the file - at which point nothing worked.  I will reload RasPBX on an SD card and rebuild my extensions.  Again - thanks.  Hank - K1DOS
nc8q
nc8q's picture
'/boot' does not get moved

Hi, Hank:

I move the the 'root' filesystem, '/', but not the '/boot' filesystem.
Booting starts from the SD card (/dev/mmcblk0p1), then mounts the
root filesystem ('/') from the HDD (your /dev/sda2 perhaps)

df -h (Display filesystems, human readable)

gelmce@nc8q-raspbx:~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 230G 2.4G 216G 2% / ; The HDD is mounted as root ('/')
...
/dev/mmcblk0p1 75M 22M 54M 29% /boot ; The SD is still /boot. It is a read-only action.

I do not change the mounting of the /boot partition. /boot remains on the SD card.

The root partition ('/') gets changed to the HDD.

gelmce@nc8q-raspbx:~ $ sudo fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 3.7 GiB, 3965190144 bytes, 7744512 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: 0x000ee283

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 155647 153600 75M c W95 FAT32 (LBA) ; This is mounted as /boot
/dev/mmcblk0p2 157696 7626751 7469056 3.6G 83 Linux ; This is not used. It was copied to the HDD.

gelmce@nc8q-raspbx:~ $ sudo fdisk -l /dev/sda

Disk /dev/sda: 232.9 GiB, 250025607168 bytes, 488331264 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: 0x8c49db98

Device Boot Start End Sectors Size Id Type
/dev/sda1 8192 137215 129024 63M e W95 FAT16 (LBA) ; This is the image from the 'dd' image copy. Not used.
/dev/sda2 137216 488331263 488194048 232.8G 5 Extended
/dev/sda5 139264 204797 65534 32M 83 Linux
/dev/sda6 204800 488331263 488126464 232.8G 83 Linux ; This is the root partition. Mount this as '/'.
-----
gelmce@nc8q-raspbx:~ $ cat /boot/cmdline.txt
#dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/sda6 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
gelmce@nc8q-raspbx:~ $

Commented out, was mounting root=SD card partition 'p2'
Now, mounting root= HDD partition 'sda6'

Depending on the install (raspbx image, NOOBS image, or Raspbian image),
your partitions may be different. I think the /boot partition will likely always be '1'.

I hope this helps.
Chuck

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer