LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Installing from USB bootable drive to laptop HDD (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/installing-from-usb-bootable-drive-to-laptop-hdd-4175616106/)

ZXDunny 10-21-2017 12:15 PM

Installing from USB bootable drive to laptop HDD
 
Hi all - sorry if this is the wrong place to ask this, but...

I have a bootable USB drive (syslinux) that boots a squashfs filesystem into a stripped-down debian distro that automatically launches an emulator for an old piece of hardware.

When booted, the laptop basically becomes an Amiga.

Unfortunately, the USB drive is only 16GB and I'm getting pushed for space. What I'd like to do is to transfer the files from the USB drive to the laptop's internal (Fat32) HDD and boot from that without needing the USB drive anymore. The HDD is much larger (500GB) and the laptop won't have that USB stick hanging out the side anymore...

Can it be done? I've done some cursory searching around the web and turned up basically nil for this.

Grateful for any help!

fatmac 10-21-2017 12:51 PM

Sounds like you could install syslinux to your HDD, then copy everything from your USB drive to the HDD. :)

ZXDunny 10-22-2017 04:02 AM

Quote:

Originally Posted by fatmac (Post 5772400)
Sounds like you could install syslinux to your HDD, then copy everything from your USB drive to the HDD. :)

It worked :)

Ok, I'm still booting into a squashfs filesystem, but that's no biggie tbh - It's not intended to be a linux box, but an Amiga after all...

Was fun getting the drive prepped with fdisk, figuring out how to create a new partition (the drive was completely unformatted), then mounting it, copying all the stuff over and finally installing Syslinux and the MBR. But once done - about half an hour's work tops - it's running flawlessly.

Many thanks, I didn't think it would be this easy!

ZXDunny 10-22-2017 04:39 AM

Ok, there is one small problem with running from a squashfs filesystem - can't upgrade the internal emulator. I could move the binaries out to the (external to the squashfs) filesystem and launch them from a script, but it might be better to have the whole thing unpacked.

Can this just be done with no issues, or are there things I need to be aware of?

fatmac 10-22-2017 05:44 AM

If it is a Linux system, it will need a Linux file system, not fat32, but otherwise, yes, you can extract the squashfs to disk.
I think your syslinux config will need editing, but other than that, I think it should work OK.
So you will need to work from the USB drive again to achieve this setup, as you will have to reformat the HDD.
Use the squashfs tools to unpack it.

aragorn2101 10-26-2017 03:30 AM

Quote:

Originally Posted by ZXDunny (Post 5772566)
Ok, there is one small problem with running from a squashfs filesystem - can't upgrade the internal emulator.

Dude, may I suggest: if you are going to boot and work on the HDD, then why not install a proper Debian distro there, with the drive properly partitioned and the ext4 filesystems?

jefro 10-30-2017 07:06 PM

A squashfs is a sort of locked file to the running OS. The Live distros like that can't fully or properly be upgraded. As you can see you can't update that application. The solution would be to fix the squashfs (not easy) or as noted to use a proper install. One could do that to a usb drive or an internal drive with most modern distros.

A squashfs is generally compressed and it does tend to make the OS seem faster usually. The slow drive access versus faster processor deal.

Shadow_7 10-31-2017 01:40 AM

There's other options to fdisk, like cfdisk (what I normally use), gdisk, parted, gparted, and others.

You can mount a squashfs file to a mount point. -t squashfs (or was it just squash). Although you might need to install tools not installed by default.

If you have another bootable linux you can mount the squashfs stuff and rsync it to ext4 or other filesystem types. Install and configure the bootloader (in a chroot) plus change the /etc/fstab to know it's new home and you're off to the races. There can be complications if /boot/ is it's own thing and such, but most everything is a file on linux, so as long as your filesystem has all the files and the bootloader works, good to go. Other potential issues with lvm or encryption, but not that common on live media. The main trick is to have multiple bootable linux's so you're not dealing with a live linux distro when copying it. You can copy a live one while in use, but it's much simpler not to do that. Plus avoiding a few potential issues.


All times are GMT -5. The time now is 03:20 AM.