munklefish
Posts: 88
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
Contact: Website

Re: Running Raspbian from USB Devices : Made Easy

Wed Jan 01, 2020 9:59 pm

chmod +x usb-boot
I didn't know about that bit. I can now get the script to run without using forcing bash.

As for the drive it was definitely working when I took it out of a Windows PC. What's the best state for the drive to be in prior to running this script? Should it be unpartitioned/unformatted, or would fomatting it with a single partition be better( if so what file structure)?

Thanks.
http://www.codeclinic.de

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Wed Jan 01, 2020 10:10 pm

munklefish wrote:
Wed Jan 01, 2020 9:59 pm
chmod +x usb-boot
I didn't know about that bit. I can now get the script to run without using forcing bash.

You can't execute any program or script in Linux without first making it executable .
munklefish wrote:
Wed Jan 01, 2020 9:59 pm
What's the best state for the drive to be in prior to running this script? Should it be unpartitioned/unformatted, or would fomatting it with a single partition be better( if so what file structure)?

It shouldn't matter, but you could try deleting all partitions first. Even better would be to use imageUSB to 'Zero USB drive' (Boot Sector(s) Only).

munklefish
Posts: 88
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
Contact: Website

Re: Running Raspbian from USB Devices : Made Easy

Wed Jan 01, 2020 10:15 pm

It shouldn't matter, but you could try deleting all partitions first. Even better would be to use imageUSB to 'Zero USB drive' (Boot Sector(s) Only).
Great, I'll give that a try in the morning.
http://www.codeclinic.de

munklefish
Posts: 88
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
Contact: Website

Re: Running Raspbian from USB Devices : Made Easy

Thu Jan 02, 2020 3:22 pm

I tried that and got the same output. I checked the drive and it's at 85% health according to CrystalDisk.

Any suggestions?
http://www.codeclinic.de

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Thu Jan 02, 2020 3:34 pm

munklefish wrote:
Thu Jan 02, 2020 3:22 pm
I tried that and got the same output. I checked the drive and it's at 85% health according to CrystalDisk.

Any suggestions?

Did you try a USB flash drive instead?

munklefish
Posts: 88
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
Contact: Website

Re: Running Raspbian from USB Devices : Made Easy

Thu Jan 02, 2020 4:29 pm

Did you try a USB flash drive instead?
No because I've spent a lot of money on specifically using an SSD.
http://www.codeclinic.de

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Thu Jan 02, 2020 4:39 pm

munklefish wrote:
Thu Jan 02, 2020 4:29 pm
Did you try a USB flash drive instead?
No because I've spent a lot of money on specifically using an SSD.

No one else has reported this problem with usb-boot. If you're not willing to attempt some troubleshooting, I'm afraid I can't be of much help.

Brad Q
Posts: 69
Joined: Mon Aug 12, 2019 12:10 am

Re: Running Raspbian from USB Devices : Made Easy

Thu Jan 02, 2020 5:14 pm

I think the reasoning behind trying a flash drive is to see if it is a problem with that USB drive. There have been a number of drives found in the past that do not work reliably with the Pis. Another possibility is that it is drawing more power than the Pi4 can reliably supply (assuming the drive is not on its own power supply). Being unfamiliar with the checking utility you are using, should it not report back 100% healthy on a new drive?

I have been using USB-boot for months (August-September?) and the only issues I have had with it were due to my own stupidity.

munklefish
Posts: 88
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
Contact: Website

Re: Running Raspbian from USB Devices : Made Easy

Thu Jan 02, 2020 6:07 pm

Brad Q wrote:
Thu Jan 02, 2020 5:14 pm
Being unfamiliar with the checking utility you are using, should it not report back 100% healthy on a new drive?
Yes, but this isn't a new drive as previously stated. It is a fully operation SSD that has been wiped clean and shows as well within expected health levels for a usable SSD.
Brad Q wrote:
Thu Jan 02, 2020 5:14 pm
Another possibility is that it is drawing more power than the Pi4 can reliably supply (assuming the drive is not on its own power supply).
Power isn't an issue. I'm using a power regulating board with a 12v power supply giving more than 4amps at 5v.
http://www.codeclinic.de

munklefish
Posts: 88
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
Contact: Website

Re: Running Raspbian from USB Devices : Made Easy

Thu Jan 02, 2020 6:09 pm

RonR wrote:
Thu Jan 02, 2020 4:39 pm
No one else has reported this problem with usb-boot. If you're not willing to attempt some troubleshooting, I'm afraid I can't be of much help.
When did I say I was unwilling to "attempt to troubleshoot"? I simply said I hadn't tried a usb stick since I'd spent a lot of money dedicated towards specifically using an SSD.
http://www.codeclinic.de

fiedel
Posts: 4
Joined: Fri Jan 03, 2020 8:32 pm

Re: Running Raspbian from USB Devices : Made Easy

Fri Jan 03, 2020 8:45 pm

Hi,
I have made use of the usb-boot script on a R2 I have running Pi-hole and it worked great, however I have a second Raspberry PI that I would like to run of a SSD. When I try to run the script it exits with :

"The file /dev/sda2 does not exist and no size was specified."

It seems that the partition(s) on my SSD changes after the script has been executed. Have you seen this before or could it just be some funky stuff with my SSD ?

Output from the Pi :

[email protected]:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465,8G 0 disk
├─sda1 8:1 0 256M 0 part
└─sda2 8:2 0 1,9G 0 part
mmcblk0 179:0 0 14,5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 14,2G 0 part /
[email protected]:~ $ sudo ./usb-boot
USB Boot

┌────────┤ USB Mass Storage Devices ├─────────┐
│ │
│ Select the USB mass storage device to boot │
│ │
│ (*) /dev/sda │
│ │
│ │
│ │
│ │
│ │
│ <O.k.> <Afbryd> │
│ │
└─────────────────────────────────────────────┘



Replicating BOOT/ROOT contents from /dev/mmcblk0 to /dev/sda (this will take a while)
The file /dev/sda2 does not exist and no size was specified.

Unable to create ROOT filesystem

[email protected]:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465,8G 0 disk
└─sda1 8:1 0 4M 0 part
mmcblk0 179:0 0 14,5G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 14,2G 0 part /
[email protected]:~ $
Best Regards
Anders

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Sat Jan 04, 2020 2:43 am

fiedel wrote:
Fri Jan 03, 2020 8:45 pm
It seems that the partition(s) on my SSD changes after the script has been executed. Have you seen this before or could it just be some funky stuff with my SSD ?

It appears you're having the same problem that user munklefish is experiencing (see a few posts back). This is the first reports of such a problem in more than two years.

The partitions on your SSD should change after usb-boot is executed. usb-boot runs fdisk and creates a new Master Boot Record containing a 256 MB boot partition and root partition containing the remainder of space. I received a new 500 GB Samsung EVO 860 SSD yesterday and just tried your scenario and it completes as expected:
[email protected]:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 256M 0 part
└─sda2 8:2 0 1.9G 0 part
mmcblk0 179:0 0 14.9G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 14.6G 0 part /

[email protected]:~ $ sudo ./usb-boot

Select /dev/sda
Select <Ok>
Select <Yes> to 'Replicate BOOT/ROOT contents from /dev/mmcblk0 to /dev/sda?'
Select <Yes> to 'Do you wish to continue?'
Replicating BOOT/ROOT contents from /dev/mmcblk0 to /dev/sda (this will take a while)

BOOT/ROOT contents replicated from /dev/mmcblk0 to /dev/sda

SD card must remain in place to boot the USB device

[email protected]:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 256M 0 part
└─sda2 8:2 0 465.5G 0 part
mmcblk0 179:0 0 14.9G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 14.6G 0 part /

I would suggest using a USB flash drive instead of the SSD as a test. If there's no problem with a USB flash drive, we need to determine what is 'special' about your SSD.

fiedel
Posts: 4
Joined: Fri Jan 03, 2020 8:32 pm

Re: Running Raspbian from USB Devices : Made Easy

Sat Jan 04, 2020 11:47 am

I would suggest using a USB flash drive instead of the SSD as a test. If there's no problem with a USB flash drive, we need to determine what is 'special' about your SSD.
It does work when I use a USB stick instead of the SSD, I get a 256M boot partion and a second partition with remaning space.
The replication of /boot/root contents from SD to USB is succesfull.

I was wondering if there could be some issue in the SSD partion table since the only partition on there after the script was a 4M vfat.
Could it also be the case that the SSD was a "hybrid" MBR/GPT, don´t now if it would matter.

I manually setup the SSD to be root filesystem, and it worked ok.

munklefish
Posts: 88
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
Contact: Website

Re: Running Raspbian from USB Devices : Made Easy

Sat Jan 04, 2020 12:17 pm

fiedel wrote:
Sat Jan 04, 2020 11:47 am

I was wondering if there could be some issue in the SSD partion table since the only partition on there after the script was a 4M vfat.
Could it also be the case that the SSD was a "hybrid" MBR/GPT, don´t now if it would matter.

I manually setup the SSD to be root filesystem, and it worked ok.
Same with me. I did the manual route and have had no problems so far.
http://www.codeclinic.de

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Sat Jan 04, 2020 8:04 pm

fiedel wrote:
Sat Jan 04, 2020 11:47 am
I would suggest using a USB flash drive instead of the SSD as a test. If there's no problem with a USB flash drive, we need to determine what is 'special' about your SSD.
It does work when I use a USB stick instead of the SSD, I get a 256M boot partion and a second partition with remaning space.
The replication of /boot/root contents from SD to USB is succesfull.

I was wondering if there could be some issue in the SSD partion table since the only partition on there after the script was a 4M vfat.
Could it also be the case that the SSD was a "hybrid" MBR/GPT, don´t now if it would matter.

I just took my 500 GB SSD over to Windows and zeroed out its boot sectors with imageUSB. I then had Windows initialize it with a GPT and format it to NTFS. I brought it back to the Raspberry Pi 4 and it looked liked this:

Code: Select all

[email protected]:~# fdisk -lu /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Generic
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 53136FBA-CF5D-47F5-8F07-8066A8F2FED3

Device      Start       End   Sectors   Size Type
/dev/sda1      34    262177    262144   128M Microsoft reserved
/dev/sda2  264192 976771071 976506880 465.7G Microsoft basic data

Partition 1 does not start on physical sector boundary.

Then I ran usb-boot which completed successfully:

Code: Select all

[email protected]:~# ./usb-boot

Replicating BOOT/ROOT contents from /dev/mmcblk0 to /dev/sda (this will take a while)

BOOT/ROOT contents replicated from /dev/mmcblk0 to /dev/sda

SD card must remain in place to boot the USB device

The SSD then looked like this:

Code: Select all

[email protected]:~# fdisk -lu /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Generic
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x93e21b3d

Device     Boot  Start       End   Sectors   Size Id Type
/dev/sda1         8192    532480    524289   256M  c W95 FAT32 (LBA)
/dev/sda2       540672 976773167 976232496 465.5G 83 Linux

Upon reboot, the SDD came up as expected.

Now that you've succeeded manually, does usb-boot still fail if you run it on that SSD?

I would love to get to the bottom of the problem you're having, but I can't reproduce it here. Without some additional clues, I'm at a loss as to what to suggest. usb-boot simply uses fdisk to create a new empty DOS partition table on the SSD, creates FAT32 and EXT4 partitions, mounts them, and rsync's the SD card to them. There's nothing exotic going on (it's the same thing you would do manually).

fiedel
Posts: 4
Joined: Fri Jan 03, 2020 8:32 pm

Re: Running Raspbian from USB Devices : Made Easy

Sun Jan 05, 2020 1:51 am

Hi RonR,

This is what I tried :
Shutdown the Rpi and removed the SSD
Wrote a clean image (Raspbian Buster Lite) to the SD card
Attached the SSD to the Rpi
Booted the Rpi and ran "lsblk"

Code: Select all

[email protected]:~ $ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 465.8G  0 disk
ââsda1        8:1    0    16G  0 part
ââsda2        8:2    0 449.7G  0 part
mmcblk0     179:0    0  14.5G  0 disk
ââmmcblk0p1 179:1    0   256M  0 part /boot
ââmmcblk0p2 179:2    0  14.2G  0 part /
Then I copied the usb-boot script to the Rpi via ftp and made it executable "sudo chmod +x usb-boot"
Ran the script "sudo ./usb-boot"

Code: Select all

Replicating BOOT/ROOT contents from /dev/mmcblk0 to /dev/sda (this will take a while)
The file /dev/sda2 does not exist and no size was specified.

Unable to create ROOT filesystem
Checked again with "lsblk" and the weird 4M partion was back.

Code: Select all

[email protected]:~ $ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0 465.8G  0 disk
ââsda1        8:1    0     4M  0 part
mmcblk0     179:0    0  14.5G  0 disk
ââmmcblk0p1 179:1    0   256M  0 part /boot
ââmmcblk0p2 179:2    0  14.2G  0 part /
[email protected]:~ $
Really don´t have a clue how to deal with this, but at least I can do it the "hard" way and my SSD will do the root file system.
As mentioned earlier the script ran perfectly on my other pi which is running Pi-Hole also on Raspbian Buster Lite but with a 32G USB3 thumb drive.

EDIT : Ran the fdisk command you used if you could use this info

Code: Select all

[email protected]:~ $ fdisk -lu /dev/sda
fdisk: cannot open /dev/sda: Permission denied
[email protected]:~ $ sudo fdisk -lu /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ASM105x
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: 0x87a970c2

Device     Boot  Start    End Sectors Size Id Type
/dev/sda1       532480 540672    8193   4M 83 Linux
[email protected]:~ $

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Sun Jan 05, 2020 2:05 am

@fiedel

I assume you're running usb-boot from the SD card and you don't have the SSD mounted anywhere?

Your SSD looks identical to mine (Samsung 500 GB EVO 860) except mine is running off of a JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge controller.

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Sun Jan 05, 2020 2:42 am

@fiedel

After a closer look, there is a difference in our SSD's:

Mine:

Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Yours:

Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes

I don't know if it's the SSD's or the way the controllers present them. I also don't know if it's significant.

You said you have no problems doing things manually. Is there a written procedure you followed that I can view?

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Sun Jan 05, 2020 4:14 am

@fiedel
@munklefish

I'm 99.99% sure the problem is related to your SATA to USB adapters. I dug out an ASMedia Technology Inc. adapter and can reproduce the problem with it (I've been using a Plextor case that uses a JMicron controller). For reasons that are unclear, fdisk will not allow the starting sector to be less than 65535 when an ASMedia adapter is used. usb-boot uses the same starting sector (8192) that is used in Raspbian images. Everything appears to be happy with a starting sector of 8192 on an ASMedia adapter except fdisk. I need to do some more investigating, but you can get around the problem in the meantime by making the following change at the beginning of usb-boot:

Change:

Code: Select all

BOOTBEG=8192
BOOTEND=532480
ROOTBEG=540672

to:

Code: Select all

BOOTBEG=65535
BOOTEND=589823
ROOTBEG=598015

EDIT:

It looks like a better fix is to leave the sector numbers alone and change:

Code: Select all

    fdisk "${USB_DEST}" <<EOF &> /dev/null

to:

Code: Select all

    fdisk -c=dos "${USB_DEST}" <<EOF &> /dev/null

fiedel
Posts: 4
Joined: Fri Jan 03, 2020 8:32 pm

Re: Running Raspbian from USB Devices : Made Easy

Sun Jan 05, 2020 11:44 am

RonR wrote:
Sun Jan 05, 2020 2:42 am

You said you have no problems doing things manually. Is there a written procedure you followed that I can view?
I did the following (didn´t use a guide but did it from what I could remember) (-:

Used win32diskimager to write raspbian to SD.
Booted from SD.
Attached the SSD
Used Fdisk to delete partitions on /dev/sda
Used Fdisk to create 2 partitions on SSD, wrote changes
Mounted SSD (/dev/sda2) on /mnt/
Ran "blkid" to get PARTUUID for /dev/sda2
Edited /mnt/etc/fstab with the PARTUUID from /dev/sda2
Edited /boot/cmdline.txt with the PARTUUID from /dev/sda2
Ran "rsync -axv / /mnt"
Then rebooted the PI and checked with lsblk that root was on SSD and it was :-)
But then after updating the PI and running "raspi-config" I checked with "lsblk" again and the root was back on the SD card, my SSD had been given a new PARTUUID, so I edited fstab and cmdline.txt again to the new value and it has not changed since.
EDIT:

It looks like a better fix is to leave the sector numbers alone and change:

Code: Select all

fdisk "${USB_DEST}" <<EOF &> /dev/null


to:

Code: Select all

fdisk -c=dos "${USB_DEST}" <<EOF &> /dev/null
I will try to do it this evening :-)
Thanks mate

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Sun Jan 05, 2020 7:19 pm

fiedel wrote:
Sun Jan 05, 2020 11:44 am
EDIT:

It looks like a better fix is to leave the sector numbers alone and change:

Code: Select all

fdisk "${USB_DEST}" <<EOF &> /dev/null


to:

Code: Select all

fdisk -c=dos "${USB_DEST}" <<EOF &> /dev/null
I will try to do it this evening :-)
Thanks mate

I'm pretty confident the addition of the '-c=dos' option to the fdisk command is going to fix your problem.

ASMedia controllers report an optimal I/O size which is not a power of 2 multiple of sector size which causes fdisk to place an unnecessary restriction on the starting sector number:

Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes

JMicron controllers properly report:

Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Maze_fr
Posts: 46
Joined: Wed Dec 04, 2019 9:57 pm
Location: France

Re: Running Raspbian from USB Devices : Made Easy

Mon Jan 06, 2020 1:51 pm

I had the same problem about "Unable to create ROOT filesystem", and it was also with a SSD.
I didn't report it because then I said no to "copy" and I did it manually.
"Don't believe in forum signature quotations, they may be fakes" - Victor Hugo

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Mon Jan 06, 2020 6:52 pm

Maze_fr wrote:
Mon Jan 06, 2020 1:51 pm
I had the same problem about "Unable to create ROOT filesystem", and it was also with a SSD.

Would you mind doing an 'lsusb' and posting the line pertaining to your SSD adapter? It should look something like this:

Code: Select all

ASMedia Technology Inc. Name: ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge

I'd like to determine if the problem is limited to ASMedia Technology Inc. controllers.

I'm 99.99% confident the addition of a '-c=dos' option to the fdisk command will fix the problem regardless.

The result of a 'sudo fdisk -lu /dev/sdX' (where sdX is the SSD adapter) would also be helpful:

Code: Select all

[email protected]:~# sudo fdisk -lu /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Generic
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xa8790229

Device     Boot  Start       End   Sectors   Size Id Type
/dev/sda1         8192    532480    524289   256M  c W95 FAT32 (LBA)
/dev/sda2       540672 976773167 976232496 465.5G 83 Linux

Thanks!

Maze_fr
Posts: 46
Joined: Wed Dec 04, 2019 9:57 pm
Location: France

Re: Running Raspbian from USB Devices : Made Easy

Tue Jan 07, 2020 8:09 pm

RonR wrote:
Mon Jan 06, 2020 6:52 pm
Would you mind doing an 'lsusb' and posting the line pertaining to your SSD adapter?
I'd like to determine if the problem is limited to ASMedia Technology Inc. controllers.

The result of a 'sudo fdisk -lu /dev/sdX' (where sdX is the SSD adapter) would also be helpful

Thanks!
lsusb :

Code: Select all

Bus 002 Device 002: ID 174c:1153 ASMedia Technology Inc. ASM1153 SATA 3Gb/s bridge
fdisk :

Code: Select all

Disk /dev/sda: 119,2 GiB, 128035676160 bytes, 250069680 sectors
Disk model: AS2115          
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: 0xe304cdb3

Device     Boot  Start       End   Sectors  Size Id Type
/dev/sda1         8192    532479    524288  256M  c W95 FAT32 (LBA)
/dev/sda2       532480 250069679 249537200  119G 83 Linux
As the cloning of the script didn't work, I installed Raspian on both (SD and SSD) then I copied manually both partitions from SD to SSD (because I upgraded Raspbian before using the script).
I just did a 'rpi-update" and a 'apt full-upgrade', and we can see by the used space of partitions that it worked : SD '/boot' is bigger than SSD '/boot' and SSD '/' is bigger than SD '/'.

lsblk :

Code: Select all

NAME          SIZE FSUSED TYPE MOUNTPOINT
sda         119,2G        disk 
├─sda1        256M  51,8M part /media/pi/boot
└─sda2        119G   3,7G part /
mmcblk0      29,7G        disk 
├─mmcblk0p1   256M  52,2M part /boot
└─mmcblk0p2  29,5G   2,8G part /media/pi/rootfs
"Don't believe in forum signature quotations, they may be fakes" - Victor Hugo

RonR
Posts: 788
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Running Raspbian from USB Devices : Made Easy

Tue Jan 07, 2020 8:26 pm

@Maze_fr

Thanks for info.

It appears that ASMedia Technology Inc. controllers are the only ones having a problem.

After a little more testing, I'll be posting an updated usb-boot script.

In the meantime, simply adding a '-c=dos' option to the fdisk command fixes the problem:

Code: Select all

    fdisk -c=dos "${USB_DEST}" <<EOF &> /dev/null

Return to “Advanced users”