Re Programming usb bootloader on blue pill

Recently I needed to upload new software using ST-link V2 on a blue pill which had already worked in the past.

Until 4 months ago I was using the usb port by installing the generic_boot20_pc13.bin. When this week I used ST_link to upload a new file, arduino ide apparently over wrote the bootloader since Ubuntu was unable thereafter to see the port. Why?

I then reinstalled the above bootloader with ST-link. Dmesg reported that board connected BUT it did not allocate a port i.e. /dev/ttyACM0. I tried various solutions from the internet with no luck.

In desperation i installed generic_boot20_pc13_fastboot.bin and this time the port was allocated. This bin file is about 20k long vs the other which is about 7k. The only difference in my setup from 4 months ago is that Ubuntu has upgraded its software several times since then.

Any idea what is happening please?

How did you measured the 20k size of the bootloader firmware?
Please note that the size of the file itself may be different from the size of the enclosed firmware in it

PS
I wonder why you need a bootloader if you have an St-link and you know how to load code with it?

Apologies. I don't know how the 8K came about.

I got the file length from the Github repository. It is at the top left of the page. This info is also available in the file explorer of the PC. Both are of equal length. I must have highlighted something else at the time.

The main use of the bootloader for me is that my script sends data over the serial port and having one connection both for programming and serial data transfer would simplify the work.

Although the latter bootloader did get recognised by the PC and a port was allocated I still got errors when trying to upload.

I would be happy just to have the usb working just for communicating and use the st-link for uploading. At the moment I am having to connect an external usb to TTL convertor to PA9, PA10 to work.