# You Think You Know Linux?!

#### bryangoodrich

##### Probably A Mammal
Because if you do, I could really use some guidance. If I can't figure this out, and I've been working on it since last night, I'm going to have to break down and hit up one of the Linux forums.

I installed Ubuntu 11 and quickly shifted over to the Xubuntu desktop. I did this using PenDriveLinux to install Ubuntu to my USB flash drive. Everything worked fine. I figured it should be just as easy to do this with Puppy Linux. Not quite. I used both PenDriveLinux (through WINE) and UNetbootin. They give basically the same result, and so do I when I do it manually. When I try to boot, it should start up syslinux. The default config file from the isolinux is

Code:
default puppy
display boot.msg
prompt 1
timeout 50

F1 boot.msg
F2 help.msg
F3 help2.msg

label puppy
kernel vmlinuz
append initrd=initrd.gz pmedia=cd
Which I modify the pmedia value to pmedia = usbflash. Frankly, it can be left off and Puppy will autodetect the source I believe. I've also read you should leave a blank file named USBFLASH in the root folder. None of this matters since I can't get the boot loader to, you know, boot! I don't get a prompt. Nothing. It either hangs or when I apparently mess something up it just waits and then boots from the HDD.

I've generated everything manually, too. I used fdisk and mkfs.vfat to write the partition and format it. I've even written the syslinux mbr from /usr/lib/syslinux/ (mbr.bin) using

Code:
dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdc
I've also simply used the syslinux command to install (all of -i, -f, and -s option flags). Still, nothing.

This morning I decided that since the Ubuntu installation worked, I looked at it. It appears to use a combination of boot chaining grub and syslinux. I've read you can just forget syslinux and use grub, though. In any case, I used grub-install to write an mbr to my flash drive, and I edited a grub.cfg file that should have options that work by looping back onto the iso file. Still, nothing loaded. This loopback method doesn't work in my case anyway.

Oh, and I should mention, the recommended way to install Puppy to USB is to first burn a CD (I did) and start up with that. Then use their Puppy Universal Installer to put it onto the USB (I did). The result was basically the same thing UNetbootin did and what I did manually. The result was the same. It hangs.

Do you think I am right that this is a syslinux problem? Any suggestions on how to make it work? Anyone familiar with chain booting grub and syslinux so that I can make this work like it did with Ubuntu?

#### Dason

I have no idea how to fix your problem. The one time I tried out puppy linux I did the CD -> Puppy Universal Installer -> USB and it worked for me. I had one issue once where Ubuntu got totally messed up and it took a few days to get everything back to normal (with a lot of messing around with grub :s). It's tough stuff and I'm not envious of you right now. Best of luck in getting it all figured out.

#### leavesof3

##### New Member
I had a similar problem, due to the fact that my desktop computer(Gateway pentium roughly 10 years old) wouldn't boot from usb or cd. I completely worked around the problem of dealing with grub by borrowing a usb drive adapter(where my desktop hard drive would be treated as an external hard drive) and used my netbook to install linux(I use mint) on the drive. I then just booted from hard disk which worked great and then edited the boot sequence with start up manager. So if you have another computer I'd recommend it for easiness. If you don't have a usb adapter then it will cost you something.

Is there anyway you can go back to your old working setup? You could set up a dual boot of your old linux version and ubuntu and once it's installed delete the old version.

I think it might be an issue with your BIOS and if it were me I wouldn't mess around with grub files as I never took anything past computer science I.

#### bryangoodrich

##### Probably A Mammal
No, it's not my BIOS. Like I said, I installed Ubuntu from the same USB. Now that I'm using Xubuntu, I want to convert my USB flash drive to a usable Puppy Linux (to make it my "Pup Toolkit"). The problem I believe is that syslinux alone is not sufficient to boot on my old system. Ubuntu worked, but it uses a combination of grub and syslinux. I tried to use grub alone from an approach a guy at PenDriveLinux used, wherein you have grub mount a loopback onto the iso image kept on the drive. That didn't work out for me, though. From everything I've seen, I manually set my drive up correctly. I used the syslinux mbr and even tried a different one when using Puppy Universal Installer. I also tried a lilo -M /dev/sdc to write another mbr.

The set up is actually pretty basic. It only requires three files to run Puppy: the sfs, which is the biggest file and contains all of Puppy (it's a squished file system); the vmlinuz, which is the basic linux kernel that gets loaded into memory, and initrd.gz, which is a compressed ramdisk that contains a complete basic linux system. Everything else is syslinux or some other bootloader. Everything I've seen in the Puppy community, however, is about setting up syslinux, for good reason: it's pretty simple and lightweight. But I've not seen anything about someone have problems similar to mine.

I'll probably have to wait until next weekend to play around some more, as I have a busy week ahead of me. My next attempt will be to review what is written when I convert the drive to a Ubuntu USB and work off of that. I might also try a lilo boot manager instead. I should also look into using grub without the loopback method, but from my experience, grub sucks lol

#### bryangoodrich

##### Probably A Mammal
I've even gone a step further to simplify things. My syslinux.cfg only contains one thing:

Code:
default vmlinuz initrd=initrd.gz pmedia=usbflash
You can't get more simple than that! It basically says default to running the vmlinuz kernel in the initrd.gz ramdisk telling Puppy it is a usb flash drive. No menu. No options. Just boot up to the provided stuff. My directory is therefore just as basic:

Code:
initrd.gz    -- Compressed Ramdisk
ldlinux.sys  -- The syslinux boot loader
lupu-528.sfs -- The Puppy squished file system
syslinux.cfg -- A text file with the single line above
USBFLASH     -- A blank "text" file that should indicate to Puppy that what the directory is.
vmlinuz      -- The Linux kernel to snowball the system run.
If this doesn't work. I'll focus on simply using another bootloader.

#### bryangoodrich

##### Probably A Mammal
So I went back onto my XP partition to put Ubuntu 11.10 on my drive again, using PenDriveLinux like I did in the first place. You would think that since it worked the first time, it should work now. However, I'm getting the same problem! Now I can only assume that between wiping Ubuntu off the drive and installing other things with UNetbootin, it caused my USB to become defunct at booting? Maybe I am missing an important MBR or something that would make it work at boot properly? I'm at a loss because this level of hardware interface is beyond me. My disk still holds data, though. It's still usable. It's just not working as a bootable device anymore!

#### Dason

I was never able to get UNetbootin to create a flash drive that actually allowed me to boot either! At least in my case I know the USB was still able to be bootable because I just put puppy linux on it the other day.

#### bryangoodrich

##### Probably A Mammal
Yeah, I've not had any luck with UNetbootin yet, but PenDriveLinux (for Windows) served me well. It got me onto Ubuntu through my USB! Unfortunately, it isn't working anymore lol

I researched MBRs and following what Marlow says to come up with this sequence of steps. Comments are hashed out.

Code:
sudo fdisk -l  # Identify USB device. It's on sdc
umount /dev/sdc
sudo dd if=/dev/zero of=/dev/sdc bs=512 count = 1  # dd copies the in-file (if) to the out-file (of). In this case, I'm masking an empty device to the first 512 KB size block sector for the MBR to be placed
sudo fdisk /dev/sdc  # Delete any partitions (none) and create a primary with defaults for everything. 'a' to make it bootable and 't' with 'c' to give it a FAT type. 'w' write when done.
sudo install-mbr /dev/sdc --force  # Had to apt-get the install-mbr function. It installs the mbr on the device
mkfs.vfat -F 32 -I -n PUPPY /dev/sdc1  # This formats the partition on the device as FAT 32, names it PUPPY and 'I' should do something useful?
sudo partprobe /dev/sdc  # Mounts the USB device
sudo cp /media/iso/* /media/PUPPY/  # Copy the system files for the "disc" onto the USB
cd /media/PUPPY  # Make the USB the current working directory
sudo mv isolinux.cfg syslinux.cfg  # Rename the isolinux (CD) config files to syslinux config files
sudo mv isolinux.bin syslinux.bin  # Ditto
touch USBFLASH  # Create an empty identifier file (Puppy USB writer does this, too)
sudo syslinux -s /dev/sdc1  # Write the bootloader (stupidly) to the partition
Well, this still didn't work. I'm going to try

Code:
dd if=/dev/hda of=/dev/sdc bs=512 count=1
I don't quite know wtf /dev/zero is supposed to identify, but I know /dev/hda is my system hard drive. Therefore, using it as a basis for my MBR space should be useful. Actually, I m ight use /dev/hdb, the disk my Windows system is on. I don't think it really matters, though. I'm losing hope I'll get this figured out at this point. I've spent way too much time on it, especially since I should be writing my report for class right now lol

#### bryangoodrich

##### Probably A Mammal
As an update, I decided to try ms-sys. Unfortunately, I can't just apt-get it because Ubuntu had to remove it from its repositories due to possible copyright issues. Nevertheless, you can download it from sourceforge and do a make, make install in its directory to create it. I used it's commands

Code:
ms-sys -w /dev/sdc  # write mbr
ms-sys -w /dev/sdc1 # write boot loader
and I get a different result when I boot up: "invalid partition table"

I'm still at a loss. There shouldn't be anything wrong with the MBR at this point. I've used Windows to fix any problems and reformat the drive. I've used fdisk to write the partition tables. Still, it just doesn't want to load. It's frustrating, and I kind of want to try using Tiny Core Linux, now. I honestly wouldn't mind giving Puppy a serious try as my desktop OS (frugal install). With TCL, I could make a "data analysis workbench" so to speak. It's not made to be a whole OS. It's signature is amazingly small, and I could install a series of analysis tools that I could have with me anywhere I go. I think it could be useful. I'm afraid if I just go out and buy another USB, I'll just end up Fing it up, too now!