Banner

Banner
Ramast
Linux Developer

Thursday, October 5, 2017

Booting Linux on a 10 years old laptop using usb stick

I have an old Acer laptop (10 years old) which no longer has a functional hard disk.
So the only way to boot was using a usb stick which my laptop presumably support.
I tried to boot some Linux installed on a usbstick but isolinux bootloader would just report that there was a problem and refuse to boot.
I tried putting linux distro that support grub bootloader but again, grub gave this error: grub - error out of partition

After lot of frustration I found that the problem was that my flash memory was simply too big (7GB) and my 10 years old laptop's BIOS is not ready to deal with such massive size memory stick.


Solution?

I've created a smaller partition table and placed it on my usb stick to make it look like it's only 2GB memory stick. That surprisingly solved the problem and my laptop booted just fine.

Here is how I did it (under Linux/Unix)

First I created a 2GB empty file

fallocate -l 2G disk.img

If that didn't work, try
dd if=/dev/null of=disk.img bs=4k count=512k

Now you have a 2GB empty file, let's associate that with a loop device

losetup loop3 disk.img

So far so good, now let's create new file system on the disk.img file

fdisk /dev/loop3

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p):  <press enter and keep pressing enter until you return to the prompet>
Command (m for help): w

Final step, write the new partition table to the usb stick

dd if=disk.img of=/dev/<your usb stick dev>
(Note that would result your usb stick appear to have only 2GB capacity but this is not permanent and can be easily reverted back later)

Done, you are now ready to install whatever usb stick linux dsitro (like dsl, sysrescuecd or any other on your laptop)