LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB Sticks note to self. Boot viruses? Probably not, but I'll take precautions. (https://www.linuxquestions.org/questions/linux-newbie-8/usb-sticks-note-to-self-boot-viruses-probably-not-but-ill-take-precautions-938570/)

greatbear 04-07-2012 12:14 AM

USB Sticks note to self. Boot viruses? Probably not, but I'll take precautions.
 
This isn't a question but a few words about my recent experiences with formatting usb sticks and struggling to make bootable media. This is not intended to help people who are struggling with a problem, so if you are having a problem don't bother to read this. Its more like a journal entry about the slow process of learning to deal with my system. I may add more material later. If I can I'll make a thread about how to make usb sticks the right way. Feel free to comment if there is some resource you'd like to suggest that I read.

I have had intermittent luck with installing boot media inside Windows Vista using the 'linux downloader' as well as with Fedora's program to do the same thing. Its a cool idea though, and other people have used both successfully. I did get a good solid install of Fedora 16 i686 32-bit out of 'Linux loader' a day ago, but today I tried installing with it and something went wrong with the squash filesystems. I tried several kinds of images. I even tried downloading the same image I'd gotten before but got the same problem where the media started booting but then could not read the squashfs. What had changed?

Fortunately, I already had grub installed on a stick and had a working version of Fedora on a hard drive partition accessible through a usb stick from the previous day (Fedora on hard drive, boot loader on a stick), so I decided to learn how to create boot media from within the working system from the command line. One thing I noticed was that the usb sticks that I'd used with the linux downloader today had four or more partitions, including some of zero length. I thought that was weird. I tried following Fedora's info on preparing boot media (chapter 3.2 for version 16), however while using dd my computer cut off suddenly. Very strange, possibly due to the undocumented nature of Toshiba laptops. Its very difficult to write drivers for undocumented hardware, or so the programmers say.

I removed the partitions of the offending sticks and created one large vfat, marked it bootable, wrote the new partition table and exited fdisk. Then I formated using the mkfs.vfat command, and finally I installed grub2 (to overwrite the boot sector). I don't know why there were 4 partitions on each usb stick, and I fear boot sector viruses from windows or from the downloader program. No idea, but hopefully installing grub from within a working fedora system on a new partition will overwrite any such windows based boot sector virus. Now all of that has taken a chunk of time, so I will not be able to finish the story today.

I believe what I will try next (to make bootable media from within Fedora) is use dd with an iso image following the 3.2 instructions again, but this time I will occasionally suspend the process to let the system cool down. (Also, I've hopefully replaced the boot sector and erased any sneaky partitions.) Previously at the first attempt with the dd command my system shut off during the dd. Probably the reason it shut down the first time was that the dd was too high priority and prevented acpi from turning the fan on. Or...there was something bad on the usb stick, or there was some kind of interrupt mixup. I'm not sure if a boot sector virus would affect dd, because I don't know how the device driver works.

One more thing. In order to use the dd command at all I had to copy the image file out of my home folder. For some reason a regular user is not able to use dd on a usb drive, and I had some trouble getting the root user to use dd on a file in the home directory. Perhaps I was not typing the command in properly, but perhaps there are restrictions on root and files in the home dir. For now it can wait.

syg00 04-07-2012 02:38 AM

LQ offers (personal) blogs. This would seem better placed there.


All times are GMT -5. The time now is 01:19 AM.