Moving filesystem from sd-card to ssd

Hi,
I just moved the / filesystem to an ssd and modified the /boot/cmdline.txt:
root=/dev/sda1 rootfstype=ext4 rootwait quiet osmcdev=rbp2

After a reboot it looks fine!

But the system is automatically mounting /dev/mmcblk0p2 to /media/xxxxxxxxx

How can I disable mounting the second partition from the sd-card?

Thanks

You could move the FAT partition to the SSD and boot just from that (if your RPi is young enough) then you don’t need the SD at all.

Let me think about it…
Actually it would be ok to just boot from SD-card and keep the data on ssd.
Any chance to not mount /dev/mmcblk0p2 automatically?

I don’t understand what the downside is to having mmcblk0p2 mount, but the answer is you would have to dig in the udev rules I believe.

That’s why I don’t need mmcblk0p2 automatically mounted on system startup.

/dev/sda1 220G 2,2G 206G 2% /
/dev/mmcblk0p1 316M 30M 286M 10% /boot
/dev/mmcblk0p2 15G 2,2G 12G 17% /media/5b1a8e1f-334b-404c-b0ff-0a213e1c1f5b

Any ideas where exactly to look for disabling?

I can’t give give it to you on a plate but you might find a way to blacklist the partition based on its UUID. Here’s a USB flash drive I added to my Pi3:

osmc@osmc:~$ blkid -o udev -p /dev/sda1
ID_FS_UUID=c91adeb7-28d9-434a-99bf-b6aa283e2d9e
ID_FS_UUID_ENC=c91adeb7-28d9-434a-99bf-b6aa283e2d9e
ID_FS_VERSION=1.0
ID_FS_TYPE=ext2
ID_FS_USAGE=filesystem
ID_PART_ENTRY_SCHEME=dos
ID_PART_ENTRY_UUID=9fce7055-01
ID_PART_ENTRY_TYPE=0x83
ID_PART_ENTRY_NUMBER=1
ID_PART_ENTRY_OFFSET=2048
ID_PART_ENTRY_SIZE=60618752
ID_PART_ENTRY_DISK=8:0

A hacky workaround might simply be to include it in /etc/fstab with the noauto option. With a bit of luck udisks-glue won’t pick it up since it has the potential to be mounted. Haven’t tried it myself and am out of time for today. Good luck!

Got it, thanks:

https://discourse.osmc.tv/t/prevent-automount-of-partitions-by-uuid/15280/9

That was a complicated solution, for sure, but kudos to the poster for having the courage to deal with udisks-glue. :wink:

I managed to try out my hacky workaround in /etc/fstab – and it works. The classic one-liner!

osmc@osmc:~$ grep dummy /etc/fstab
UUID=c91adeb7-28d9-434a-99bf-b6aa283e2d9e	/mnt/dummy ext2	noauto,nofail	0	0
osmc@osmc:~$ blkid
/dev/mmcblk0p1: UUID="A269-73B7" TYPE="vfat" PARTUUID="a13c9b62-01"
/dev/sda1: UUID="c91adeb7-28d9-434a-99bf-b6aa283e2d9e" TYPE="ext2" PARTUUID="9fce7055-01"
/dev/mmcblk0: PTUUID="a13c9b62" PTTYPE="dos"

The /etc/fstab was my second choice, but Yes it works.
Thanks and take care!

1 Like