Announcement

Collapse
No announcement yet.

how to manually make a liveUSB [without liveUSB creator software]

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to manually make a liveUSB [without liveUSB creator software]

    As an exercise in curiosity, I'd like to make a bootable liveUSB of a distro from scratch--that is, without using liveUSB creators like unetbootin or LiLi. But I know by now that merely extracting the .iso onto the UFD (usb flash drive) isn't enough. I know that you need other stuff like a bootloader and whatever else, but that's the extent of my knowledge there.

    For now, I'm not going to bother adding persitence, but that is something I'd like to try later.
    I run Kubuntu 18.04 LTS.

    #2
    Code:
     sudo dd bs=4096 if=/folder/and/file.iso of=dev/sd"x" (x=your usb drive)
    On my system, it would be

    Code:
    sudo dd bs=4096 if=~/Downloads/OS/kubuntu-13.04-desktop-amd64.iso of=/dev/sdc
    Last edited by Buddlespit; Sep 13, 2013, 04:01 PM.
    I do not personally use Kubuntu, but I'm the tech support for my daughter who does.

    Comment


      #3
      Several ways. Syslinux, grub4dos, even grub will work. I have all three from different times.
      I have the syslinux booting a usb flash disk, and grub.exe running the show. It will even boot iso's directly. Makes it simple.
      Boot Info Script

      Comment


        #4
        The Debian ISOs can now be copied to a USB like this:
        Code:
        sudo cp /path/to/file.iso /dev/sd[i]X[/i]
        Where X is the letter assigned to your USB device. No partition number should be included. Essentially the same results as dd. I have not tested whether this works with Ubunutu or any of the flavors.

        Comment


          #5
          Originally posted by SteveRiley View Post
          The Debian ISOs can now be copied to a USB like this:
          Code:
          sudo cp /path/to/file.iso /dev/sd[i]X[/i]
          Where X is the letter assigned to your USB device. No partition number should be included. Essentially the same results as dd. I have not tested whether this works with Ubunutu or any of the flavors.
          Interesting, Since some people are terrified of using dd , this should alleviate their fears.

          edit: It worked but failed to identify. I copoed xubuntu to the 1gb device, and rebooted and was able to boot, then gparted on xubuntu said I had 'x' amount of space left, but couldn't created another partition, obviously, because it was mounted. rebooted to hard drive and now couldn't mount the device, with the following error:

          Code:
          Error mounting: mount: wrong fs type, bad option, bad superblock on /dev/sdc2,
                 missing codepage or helper program, or other error
                 In some cases useful info is found in syslog - try
                 dmesg | tail  or so
          edit2: Nothing would recognize the device so I blindly formatted using 'mkfs', then it warned of using /dev/sdc is entire device and not partition, so I used '/dev/sdc1' , that worked but nothing recognized it. Using 'mkfs' this time used entire device. Then I was able to create a partition.
          As I recall from the reboot forum, the dd command uses the entire device and nothing can use unused area, cp leaves unused area but creates a rather bazaar format. I'll have to play with this some more, as I'm unsure now how it was partition in the first place.
          Last edited by verndog; Sep 14, 2013, 10:31 PM.
          Boot Info Script

          Comment


            #6
            I still swear by "dd" I have a 4GB usb key that I use when I decide to distro hunt. In fact, I used it to downgrade to 13.04 yesterday.
            I do not personally use Kubuntu, but I'm the tech support for my daughter who does.

            Comment


              #7
              Thanks for your replies.

              I did some playing around with the .iso for Lubuntu Raring. (I do prefer kubuntu, but lubuntu is a quicker download.) A quick-and-dirty cp into the device file (as Steve suggested) indeed works fine--I did not experience problems with mounting the drive later, as Vern seems to have experienced. I then reformatted the ufd and tried dd, with the syntax buddle provided. I wasn't able to tell any difference between the result of that and the result of the quick-and-dirty cp.

              Since this worked, though, that means that a bootloader is included within the .iso file?

              The question I was getting at originally is why what I described above works fine, but merely extracting the files onto the ufd requires that a bootloader be added? (as I believe Vern was saying in his first post on this thread.) I came across the command
              Code:
              bash makeboot.sh /dev/whatever
              Is that command (which, I understand, adds a bootloader) for when a bootloader is not included in the .iso? Or also for when your method of extracting the .iso doesn't give you one?
              Last edited by rybnik; Sep 16, 2013, 02:40 AM. Reason: fixed BB syntax
              I run Kubuntu 18.04 LTS.

              Comment


                #8
                I think it has to do with the ISO being a hybrid ISO.

                Also I found that you can use the 'cat' as well as the 'cp'
                Boot Info Script

                Comment


                  #9
                  Indeed, the ISOs contain hybrid bootloaders. The ISO 9660 specification for optical drives doesn't include an MBR. But it's possible to embed a boot loader into the first 512 bytes of an ISO and achieve the kind of hybrid behavior we're seeing here. That bootloader is frequently SYSLINUX or ISOLINUX.

                  cating or cping or dding the ISO to your USB drive picks up everything in the ISO, including the partition table and the bootloader. Extracting/copying the ISO's contents will not include either of these; thus, it's necessary to manually configure the USB drive with a bootloader.

                  Comment


                    #10
                    Consider, for the sake of argument, an .iso that is not "hybrid." When you dd it to a ufd, it can not boot. But when you burn it to a disc, it can boot. Why's that? Does this mean that those two methods are (at a low level) procedurally different?

                    The best example of this that I can furnish is the .iso for Hiren's Boot CD--burnt to a CD, it boots fine, but dd'd to a ufd, it can't boot and my bios returns an error saying it can't find a boot sector on the ufd. I really wish I had a linux example of this, but I guess that all the linux .iso's I've used so far are "hybrid."
                    I run Kubuntu 18.04 LTS.

                    Comment


                      #11
                      Non-hybrid ISOs lack the equivalent of an MBR and thus cannot boot from a USB drive. They will boot only on ISO 9660 optical media, which follows a completely different procedure.

                      Comment


                        #12
                        Originally posted by SteveRiley View Post
                        Non-hybrid ISOs lack the equivalent of an MBR and thus cannot boot from a USB drive. They will boot only on ISO 9660 optical media, which follows a completely different procedure.
                        right ,,,,,,but for $4it's and giggles I puled out the old SanDisk Cruiser with that U3 system on it (virtual cd drive) and used the u3-tool

                        Code:
                         u3-tool 0.3 - U3 USB stick manager
                        
                        Usage: u3-tool [options] <device name>
                        
                        Options:
                                -c                Change password
                                -d                Disable device security
                                -D                Dump all raw info(for debug)
                                -e                Enable device security
                                -h                Print this help message
                                -i                Display device info
                                -l <cd image>     Load CD image into device
                                -p <cd size>      Repartition device
                                -R                Reset device security, destroying private data
                                -u                Unlock device
                                -v                Use verbose output
                                -V                Print version information
                        
                        For the device name use:
                          '/dev/sda0', '/dev/sg3'
                        to check the status of the cd partition size (I new I had monkeyed with it before)

                        Code:
                        vinny@vinny-HP-G62:/usr/share/man$ sudo u3-tool -i /dev/sdb
                        [sudo] password for vinny: 
                        Total device size:   3.77 GB (4047503360 bytes)
                        CD size:             705.81 MB (740098048 bytes)
                        Data partition size: 3.08 GB (3307405312 bytes)
                        ok so the cd partition is big enough for the HBCD.iso ,,,,lets load it

                        Code:
                        vinny@vinny-HP-G62:~/test/HBCD/Hirens.BootCD.15.2$ sudo u3-tool -l Hiren\'s.BootCD.15.2.iso /dev/sdb
                        [sudo] password for vinny: 
                        |**************************************************| 100%
                        OK
                        reboot,,,,,,,,,,,,,,,,, and it's just like the cd ......played around in partedmagick for a bit then back hear to show off ....

                        OK ,,,,,I know,,,,,,,,, not the same thing we were talking about,, but it dose get it on a stick
                        the SanDisk dose show up as 2 drives in the startup menu however , as just Sandisk .....so you half to guess which one is the virtuall cd drive but hay

                        VINNY
                        i7 4core HT 8MB L3 2.9GHz
                        16GB RAM
                        Nvidia GTX 860M 4GB RAM 1152 cuda cores

                        Comment


                          #13
                          The weird thing is that Ubuntu doesn't recognize the hybrid flash disk, but the Disk Ulitity does, and will mount it. Then Ubuntu see's it as a CDROM (has the little cddisk icon).

                          Also UbuntuGNOME also doesn't recognize it, but its Disk utility does.

                          After those Disk programs mounts the devices then everything looks normal.

                          "fdisk -l reveals this:
                          Code:
                             Device Boot      Start         End      Blocks   Id  System
                          /dev/sdd1   *          64     1409623      704780   17  Hidden HPFS/NTFS
                          /dev/sdd2         1411296     1969567      279136    0  Empty
                          blkid:
                          Code:
                          /dev/sdd1: LABEL="Lubuntu 12.04 i386" TYPE="iso9660" 
                          /dev/sdd2: LABEL="287MB" UUID="3d364100-a7c6-4296-9716-8c04a9da44b0" TYPE="ext4"
                          I used the Disk Utility to create another ext4 partition at the end of the hybrid flash. That's why I called it 287MB.

                          So it looks like the hybrid ISO is configured as a CDROM - iso9660, as Steve Riley reported.
                          Boot Info Script

                          Comment


                            #14
                            Thanks, Steve and Vern.

                            Vinny--that is very very cool. My original intent with this thread was to figure out how to get a flash drive to act like a cd/dvd, and I suppose that what you just demonstrated there is the answer. u3-tool! I didn't know there was a linux command for it! I've been so used to thinking that pre-installed software on storage media is either useless xor for idiots that I never bothered to give u3 a try. Maybe I'll re-install u3 on my sandisk flash drives.
                            I run Kubuntu 18.04 LTS.

                            Comment


                              #15
                              Originally posted by rybnik View Post
                              Thanks, Steve and Vern.

                              Vinny--that is very very cool. My original intent with this thread was to figure out how to get a flash drive to act like a cd/dvd, and I suppose that what you just demonstrated there is the answer. u3-tool! I didn't know there was a linux command for it! I've been so used to thinking that pre-installed software on storage media is either useless xor for idiots that I never bothered to give u3 a try. Maybe I'll re-install u3 on my sandisk flash drives.
                              rite then ,,, if you have some SanDisks with the U3 systems then you will want to install the u3-tool

                              it lives in the universe repo so make sure you have it enabled in muon package manager , open Muon >settings>configure software sources ,,on the Kubuntu software tab check the universe line (I have all of them checked) close that window and the package cake should update then search for u3-tool ,,,,, it should show by the time you type u3

                              VINNY
                              i7 4core HT 8MB L3 2.9GHz
                              16GB RAM
                              Nvidia GTX 860M 4GB RAM 1152 cuda cores

                              Comment

                              Working...
                              X