Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to run Debian 9 from a bootable USB but can't get it to load; the pc detects the USB and reports "Attempting to boot from USB" but then pretty much hangs, merely putting occasional sporadic random characters and small rectangular shapes onto the screen. If anybody is willing to offer any thoughts on cause or solution I'd be very grateful. This is what I've done:
I'm using a Windows 7 pc and, for clarity, have no access to a working Unix environment. [Nor, as may be obvious, have I ever installed or used Unix before.]
I created an installation disk under Windows using Rufus with the amd64 iso. This gave no problems and allows me to boot into the standard Debian Installation package; I have been using the Graphical Installation option, for simplicity, almost entirely with default options. Under the Guided Partition step I can select a second USB on my pc (in my instance "dev/sdc"), partition it, make the primary partition bootable, and install Grub into the MBR. All looks fine until I then try to use this second USB to boot Debian, which fails as described above.
I have re-run the installation routine multiple times, with different parameters for partitioning and file system, for example, but with no effect on the end result.
I have tried to investigate using the TestDisk utility from CGSecurity; this lets me view the contents of the USB from within Windows. The partitioning and directory structures look fine and grub configuration is there. Testdisk offers the option of rewriting the MBR with a "test" version; trying this option doesn't cure the problem, suggesting to me that the issue isn't with the MBR, but maybe with the Grub configuration or even some driver issue.
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,525
Rep:
Sounds like grub may be looking for the system on the wrong partition.
Check the grub config file & make sure it is booting from sda1, which is what your boot drive is, (it is likely looking for the files on sdc1, which is where you initially installed it to).
Make sure that /boot/grub/grub.cfg and /etc/fstab are pointing at a valid location. Using UUIDs for this works better as device names can shuffle when connected to usb. root=UUID=abcdefga-... for grub and UUID=abcdefga-... for fstab, where root=/dev/... and /dev/... would otherwise be.
$ sudo blkid
Otherwise disable secure boot and enable CSM/Legacy, unless you did extra steps to make it UEFI friendly. For my new-ish HP laptops I had to delete UEFI keys for it to go USB boot.
I'm gonna be controversial here and say that if you have never touched linux before then Debian (side note: it is the combined names of Debra and Ian if that gives you a clue on how to pronounce it) may or may not be very good to start with... Many users rank Debian as a "Medium" on the technical scale. It requires more under the hood work than the ones ranked easy.
If you want a user friendly linux try "Linux Mint" or maybe even "Kubuntu" both of these behave a tad bit more like windows or mac.
Thanks to all who replied - apologies for my delayed response.. Sadly, no success to report.
I have independently created a Debian Live boot USB which works perfectly. So that proves my pc will boot from USB and it does mean I can run Unix on my pc, which is helpful for diagnostics.
All references in grub.cfg on the original USB were indeed to /dev/sdc1, which I see can't be expected to work, but editing these to sda1, or sda2, or to the appropriate UUID parameter, haven't had any effect; similarly, changing references to "hd2, msdos1" as appropriate. In fact, it now seems to me, my system can't even be loading grub.cfg, since if it were I should be seeing the boot menu options listed in the grub.cfg scripts without there being any question yet of whether it can or can't then find vmlinuz... and initrd... ; isn't that true?
One thing may be relevant: the Debian Live boot USB is structured with an EFI file and partition; by contrast, the installation scripts for the Full Debian installation are creating standard partitions and a standard MBR on my USB. Given that my Hard Disk and Windows have always booted from Bios, surely thic can't be an issue?
fdisk -l gives the following (where sdb is the Live Debian boot and sdc the Full Debian disk we're discussing):
Code:
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb006752f
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 18814975 18812928 9G 27 Hidden NTFS WinRE
/dev/sda2 18814976 488394751 469579776 223.9G 7 HPFS/NTFS/exFAT
Disk /dev/sdb: 28.9 GiB, 31037849600 bytes, 60620800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x13358552
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 0 4615775 4615776 2.2G 0 Empty
/dev/sdb2 1540 2371 832 416K ef EFI (FAT-12/16/32)
Disk /dev/loop0: 2 GiB, 2180808704 bytes, 4259392 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sdc: 28.9 GiB, 31037849600 bytes, 60620800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x62c0bd95
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 50790399 50788352 24.2G 83 Linux
/dev/sdc2 50792446 60618751 9826306 4.7G 5 Extended
/dev/sdc5 50792448 60618751 9826304 4.7G 82 Linux swap / Solaris
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,525
Rep:
Perhaps the original downloaded file was corrupted, so didn't install properly - try downloading again. (There should be md5sum checksums where you download from.)
Now solved - thanks for the suggestions and guidance. For completeness I'll just record the two things that seemed to go wrong. It did come down to the bootloader.
Firstly, in the section of the installation "Install the Grub Boot Loader on a Hard Disk" it seems to be important not merely to select the relevant USB - obviously! - in my case "/dev/sdc" - but to type that identity using the "Manual" option rather than merely to select the relevant entry as listed on the page of the installer. In my experience, doing the latter created an MBR with virtually no boot code and no reference at all to the GRUB bootloader. Doing this correctly does cause the Grub bootloader screen and menu options to load - though there is a very long pause - about one minute - before it does!
Secondly, even when you've got the MBR right, grub.cfg automatically records the source from which the linux system will be subsequently loaded as having the same name as the destination to which you wrote the installation. [This was inferred by fatmac above.] This doesn't necessarily work properly. In my case, I was writing the Debian system correctly onto /sdc (because /sda was my hard disk and /sdb was my installation USB) but, of course, when I subsequently attempt to boot Debian using the USB I have just written then, because the installation disk is no longer present, there is no longer any /sdc available to load the system from. As a temporary fix, I have simply edited the few references in grub.cfg directly (from /sdc to /sdb).
If you use labels and uuids, you bypass that adjust to units / ports that have storage devices thing. In debian there's update-grub that generates the grub.cfg. This runs each time the kernel updates if you have grub installed. One caveat I found is that you should populate your /etc/fstab BEFORE installing grub to the MBR. Or manually install it again after you update /etc/fstab. If you use UUID=... (or LABEL=...) instead of /dev/... in your /etc/fstab it will use UUIDs automagically(when update-grub runs, and if you installed grub after updating /etc/fstab). At least on versions of debian less than a decade old.
The short answer is that /boot/grub/grub.cfg and /etc/fstab need to point at the same (and valid) place for it to be bootable. The UUID is partition specific, so if you go that route you can boot the drive on almost any computer with the same CPU type. With the /dev/ route, you plug in one too many storage device and you're rolling the dice if you can boot it at all.
Thanks.. I understand UUID but haven't really got my head round fstab yet. At least I can boot and the rest should follow! So far so good without needing to touch fstab myself, whose contents currently show the following:
Code:
# / was on /dev/sdc1 during installation
UUID=b99d44be-8570-44ca-a274-577220ff6b21 / ext4 errors=remount-ro 0 1
# swap was on /dev/sdc5 during installation
UUID=d84d81ab-27fd-4b03-a9cf-6da0dba83836 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.