[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query about command line commands

From: Bret Busby
Subject: Re: Query about command line commands
Date: Tue, 10 Mar 2015 14:46:46 +0800

On 09/03/2015, Andrei Borzenkov <address@hidden> wrote:
> On Mon, Mar 9, 2015 at 12:01 PM, Bret Busby <address@hidden> wrote:
>> On 09/03/2015, Andrei Borzenkov <address@hidden> wrote:
>>> В Mon, 9 Mar 2015 16:17:16 +0800
>>> Bret Busby <address@hidden> пишет:
>>>> Hello.
>>>> On a problem system, I have "GNU GRUB version 2.02~beta2"
>>>> as shown in the command line window.
>>>> The system is a UEFI/GPT system.
>>>> Three or four operating systems are apparently more or less installed
>>>> on the system, and the installation attempt of the last operating
>>>> system, broke everything.
>>>> I have found that I am able, at the GRUB command line, to run ls,
>>>> which returns a list of the partiitions (hd0,gpt<x for x= 1 to 13>).
>>>> I can also run ls (hd0,gpt<x>), which returns a description of the
>>>> partition filesystem.
>>>> I can also run ls (hd0,gpt<x>)/ , which lists the top level contents
>>>> of the partition.
>>>> Now, my query is this; with the command set that is available at that
>>>> level, can I mount a USB thumb drive (eg, mount <device descriptor>
>>>> <mount device name> (I do not know whether that would the the order of
>>>> the syntactical components, or, what would be the correct syntax),
>>> grub does not "mount" anything. It enumerates devices using firmware
>>> interfaces (BIOS or EFI) and provides you with names. So to access USB
>>> stick you would need to plug it before booting and it will be available
>>> in grub as hdX (note that exact number depends on order in which EFI
>>> probes for them).
>>>> and, direct a copy of each command and return output, to a file on the
>>>> USB drive, eg, where I have
>>> No. GRUB does not support writing to a filesystem. Nor do I quite
>>> understand what you are trying to do here and how would it help you.
>> I figured that if I would be able to do what I want, with ouputting
>> the information to a USB drive file, I would be able to show what is
>> in each partition, so as to be able to select the appropriate one(s)
>> for restoration of the system, to an operable computer system with
>> which I could select which operating system I want to boot.
> To list filesystem it is more easy and convenient to use live Linux dstro.
>> Whilst the last operating system that was attempted to be installed,
>> PC-BSD, is an operating system that I now consider too dangerous to
>> try again, due to the damage that it has done, and, therefore, I do
>> not want to be able to boot that operating system, the computer has
>> had (and apparently, still has) an installation of MS Windows 8, then
>> it had Debian 7 installed, thence the MS Win8 installation could not
>> be found,
> Which just confirms that you installed Windows and Linux in different
> modes. Because ESP lists \EFI\Windows it is strong hint that Windows
> was installed in EFI and Linux is installed in BIOS mode.

See below (at end of message).

>>                and then it had Ubuntu 14.04 LTS installed, and, the
>> Ubuntu
>> installation, with its acompanying GRUB, found Ubuntu and Debian, and,
>> I was thence able to boot into either Ubuntu of Debian (but, not MS
>> Windows),
> Again.


>>                  and, when PC-BSD was kind of installed, it buried
>> everything
>> else on the system, and, is inoperable, leaving me with a mostly
>> inoperable computer. About the only thinbg that now works on the
>> computer, is the GRUB 2.02 beta2 command line interface, with which I
>> am mostly unfamiliar, beyond getting the ls command to work, as much
>> as I have been able to get it to work.
> How do you get this grub command line interface? Does your system boot into
> it?

By pressing <ESC> while booting, to display the PC-BSD "boot menu"
(which displays as the only boot option, the unbootable PC-BSD
installation) which has, at the bottom of the screen "Press enter to
boot the selected OS, 'e'to edit the commands before booting or 'c'
for a command line"; the command line being the GRUB CLI.

> If you are in grub CLI you could boot Ubuntu (from your grub.cfg
> attached earlier) by using the same commands as in grub.cfg:
> set root=hd0,gpt12
> linux    /boot/vmlinuz-3.13.0-40-generic
> root=UUID=b96339a3-179e-4891-972e-658d35c454a6 ro
> initrd    /boot/initrd.img-3.13.0-40-generic
> boot
> You could try to omit root= but I do not know what Ubuntu does in this
> case. You can verify UUID by using "ls -l" on grub command line.

When I entered the command starting with "initrd", I got the response
"disk 'UUID=<UUID>' not found".

I have checked and rechecked that that is the correct UUID for the
partition, using both
ls -l

Which both return the same information for the partition, and, the
UUID that you stated in the command, is identical to the UUID as shown
by the system, but, the GRUB CLI appears to not recognise the UUID.

I note that, when I enter the command that you gave, that begins with
"root", no error is returned.

Plurry UUID - those things should be banned, and devices, eg
"/dev/sda<x>/", or, as in PC-BSD output below, "ada<y>p<x>" should be
used, to make it all less obscurantist and more user-friendly - "the
way it used to be".

> Oh, regarding platform - what
> echo $grub_platform
> in grub command line says?

grub> echo $grub_platform

Now, with what you have said about MSWin8 being installed in EFI mode
and Linux being installed in BIOS mode, in the course of a dummy
installation process (taking the installation process to the
particular point, and then aborting it) for PC-BSD, after the bad
installation (the one that sabotaged the system), at the stage of
"Disk Selection", using


Setup mode -> slected "Advanced" (for use of GPT partitioned HDD)

"Selected disk" - ada0 - selected (only physical HDD present)

"Selected partition" (to list the available partitions; to select one
for the installation of PC-BSD)

Use entire disk
ada0p1 400MB bios-boot)
ada0p2 300MB efi)
ada0p3 128MB ms-reserved)
ada0p4 95367MB ms-basic-data)
ada0p6 95367MB efi)
ada0p7 95367MB ms-basic-data)
ada0p8 30518MB linux-swap)
ada0p9 95367MB ms-basic-data)
ada0p10 95367MB freebsd-zfs)
ada0p11 95367MB ms-basic-data)
ada0p12 100000MB ms-basic-data)
ada0p13 100000MB ms-basic-data)
ada0p5 17409MB 1de94bba4-06dt)

which shows two partitions; partitions 2 and 6, as apparently EFI.

Now, using the GRUB CLI on that computer,

grub> ls (hd0,gpt6)
Partition hd0, gpt6: Filesystem type ext* - Last modification time
2015-02-05 05:03:11 Thursday, UUID <UUID> - Partition start at <
number of KiB> - Total size 97655808KiB

grub> ls (hd0,gpt6)/
lost+found/ var/ data1-ext4/ data2-ext2/ home/ etc/ media/ vmlinuz
sbin/ usr/ lib/ lib64/ selinux/ bin/ proc/ dev/ mnt/ sys/ tmp/ root/
boot/ run/ srv/ opt/ initrd.img seamonkey-2.26.1.tar.bz2

grub> ls (hd0,gpt12)
Partition hd0,gpt12: Filesystem type ext* - Last modification time
2015-03-09 07:43:22 Monday, UUID <UUID> - Partition start at <number
of KiB> - Total size 102400000KiB

grub> ls (hd0,gpt12)/
lost+found/ home/ etc/ media/ bin/ boot/ dev/ lib/ lib64/ mnt/ opt/
proc/ root/ run/ sbin/ srv/ sys/ tmp/ usr/ var/ vmlinuz initrd.img
cdrom/ initrd.img.old vmlinuz.old

I assume that partion 6, apart from being designated as being an EFI
partition, by the PC-BSD installation process, Disk Setup stage, is
the partition ionto which Debian 7 was installed, and that partition
12 is the partition into which Ubuntu 14.04, was installed.

Now, for the partition 2, from the GRUB CLI;

"grub> ls (hd0,gpt2)
POartition hd0,gpt2: Filesystem type fat - Label 'ESP' UUID <UUID>
Partition start at <number of KiB> - Total size 307200KiB

grub> ls (hd0,gpt2)/

grub> ls (hd0,gpt2)/efi
Microsoft/ Boot/ oem/

grub> ls (hd0,gpt2)/efi/Boot

grub > cat (hd0,gpt2)/efi/Boot/bootx64.efi
<machine code>

But, whilst, mat the start of the boot process, is displayed

"GRUB Loading
Welcome to GRUB"

No reference to Microsoft, or, to MIS Windows, as a boot option, is displayed.

Bret Busby
West Australia

"So once you do know what the question actually is,
 you'll know what the answer means."
- Deep Thought,
 Chapter 28 of Book 1 of
 "The Hitchhiker's Guide to the Galaxy:
 A Trilogy In Four Parts",
 written by Douglas Adams,
 published by Pan Books, 1992


reply via email to

[Prev in Thread] Current Thread [Next in Thread]