You are not logged in.

#1 2015-02-12 21:26:04

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Windows sistematically corrupts my Linux loader

Hello!
Some time ago I wrote about how Windows corrupt my partition: https://bbs.archlinux.org/viewtopic.php?id=192749
Now I get another error. I desided to use windows for a while, but when I was returning to my Linux, after I choose Arch Linux in gummiboot menu I got:

Error loading \vmlinuz-linux: Volume Corrupt

The same error in this topic: https://bbs.archlinux.org/viewtopic.php?id=171936

I know, that I again can  do all again for recovering linux booting: backup windows loading files, format efi partition, install linux and bootloader.
My fsck /dev/sda3 (it is my /boot) gives me the following:

fsck from util-linux 2.25.2
fsck.fat 3.0.27 (2014-11-12)
/vmlinuz-linux
  Contains a free cluster (4). Assuming EOF.
/vmlinuz-linux
  File size is 4065312 bytes, cluster chain length is 0 bytes.
  Truncating file to 0 bytes.
Reclaimed 869 unused clusters (3559424 bytes).
Free cluster summary wrong (118280 vs. really 119273)
1) Correct
2) Don't correct
? 1
Leaving filesystem unchanged.
/dev/sda3: 177 files, 11539/130812 clusters
1 root@archiso ~ #

But I am angry to Microsoft. Will they do that every time I boot to Windows? Why they touch files, that do not belongs to Windows booter? May it just make file system unreadable?

And main question: Is it possible to restrict Windows corrupting linux bootloader?

Offline

#2 2015-02-12 21:33:04

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Windows sistematically corrupts my Linux loader

Have you disabled "Fast Startup" in Windows?
http://www.eightforums.com/tutorials/63 … s-8-a.html

It can cause corruption in other operating systems.

Offline

#3 2015-02-12 21:37:52

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Windows sistematically corrupts my Linux loader

agent0 wrote:

But I am angry to Microsoft. Will they do that every time I boot to Windows? Why they touch files, that do not belongs to Windows booter? May it just make file system unreadable?

And main question: Is it possible to restrict Windows corrupting linux bootloader?

Since Windows for work groups, the installer arrogantly writes to the MBR without asking first.  What you're describing (updating it on every boot) is news to me, but I haven't run windows on my personal machine in years... probably since XP Pro without EFI support.  Anyway, I have nothing productive to add.  Hope you sort it out, or stop using that OS entirely.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2015-02-12 21:44:58

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Windows sistematically corrupts my Linux loader

Is your /boot your esp partition?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2015-02-12 21:49:54

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

Head_on_a_Stick, graysky, thanks for reply.
My fast startup option was turned on. Now I disabled it.
Now I will restore my bootloader with LiveUSB and check if Windows will continue to sabotage.

Offline

#6 2015-02-12 21:51:00

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

nomorewindows, yes, my /boot (which is /dev/sda3) is my efi system partition.

Offline

#7 2015-02-12 21:52:16

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Windows sistematically corrupts my Linux loader

agent0 wrote:

nomorewindows, yes, my /boot (which is /dev/sda3) is my efi system partition.

Windows definitely has access to that, because it also uses that.  To prevent it from altering it, you have to put it in the right place in the uefi partition.  But, yeah, Windows was pretty bad about fussing up your MBR if you installed OSs in the wrong order, and sometimes even after that.

Last edited by nomorewindows (2015-02-12 21:53:43)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#8 2015-02-12 21:56:23

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

nomorewindows, sorry for my not understanding. What do you mean under "it" in "to put it in the right place in the uefi partition"? Do you mean I need to create additional partition for /boot which will not be esp at the same time?

Offline

#9 2015-02-12 22:30:13

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: Windows sistematically corrupts my Linux loader

graysky wrote:
agent0 wrote:

But I am angry to Microsoft. Will they do that every time I boot to Windows? Why they touch files, that do not belongs to Windows booter? May it just make file system unreadable?

And main question: Is it possible to restrict Windows corrupting linux bootloader?

Since Windows for work groups, the installer arrogantly writes to the MBR without asking first.  What you're describing (updating it on every boot) is news to me, but I haven't run windows on my personal machine in years... probably since XP Pro without EFI support.  Anyway, I have nothing productive to add.  Hope you sort it out, or stop using that OS entirely.

Sounds like rootkit behaviour - offensive as it is to defend MS, this is not anything inherent in dual-booting any flavour of Windows...

Offline

#10 2015-02-12 22:53:12

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Windows sistematically corrupts my Linux loader

agent0 wrote:

nomorewindows, sorry for my not understanding. What do you mean under "it" in "to put it in the right place in the uefi partition"? Do you mean I need to create additional partition for /boot which will not be esp at the same time?

It looks like his kernel is at the root of the partition, and it goes under some farther subdirectory to go with the gummiboot or grub bootloader.  Just from what I've read in the wiki, I haven't gotten ahold of a uefi machine and done one of those yet.

satanselbow wrote:

Sounds like rootkit behaviour - offensive as it is to defend MS, this is not anything inherent in dual-booting any flavour of Windows...

Windows has a way of not messing things up with your nicely arranged partition table, anyhow.

Last edited by nomorewindows (2015-02-12 22:55:22)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#11 2015-02-12 23:20:49

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

I have created additional partition for /boot, mkfs.ext4 on it, did all prepare commands (swapon, mounts, genfstab, arch-chroot) and reinstall linux via pacman. Then  i tryed to install gummiboot, but it said

File system /boot is not a FAT EFI System Partition (ESP) file system.
error: command failed to execute correctly

Then I reformatted that partition to fat32 and tried again. Still fails:

File system /boot is not an EFI System Partition (ESP).
error: command failed to execute correctly

It seems gummiboot wants the /boot to be fat 32 esp partition.

Last edited by agent0 (2015-02-12 23:27:44)

Offline

#12 2015-02-12 23:26:14

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Windows sistematically corrupts my Linux loader

agent0 wrote:

I have created additional partition for /boot, mkfs.ext4 on it, did all prepare commands (swapon, mounts, genfstab, arch-chroot) and reinstall linux via pacman. Then  i tryed to install gummiboot, but it said

File system /boot is not a FAT EFI System Partition (ESP) file system.
error: command failed to execute correctly

Have you tried this?
       --path
           Path to the EFI system partition. The default is /boot

Offline

#13 2015-02-12 23:37:23

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

teateawhy, I was saying about reinstalling gummiboot package. But I also tryed to execute gummyboot --path=/boot install and it outputted File system /boot is not an EFI System Partition (ESP).
OK, I need to choose esp mount point as path option. But where should I mount it? I mean my esp was /boot, but what mount point esp will have now?

Last edited by agent0 (2015-02-12 23:38:26)

Offline

#14 2015-02-12 23:45:06

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Windows sistematically corrupts my Linux loader

agent0 wrote:

teateawhy, I was saying about reinstalling gummiboot package. But I also tryed to execute gummyboot --path=/boot install and it outputted File system /boot is not an EFI System Partition (ESP).
OK, I need to choose esp mount point as path option. But where should I mount it? I mean my esp was /boot, but what mount point esp will have now?

Glad you figured out the path option.

But where should I mount it? I mean my esp was /boot, but what mount point esp will have now?

You can choose any mountpoint. Be creative.

Offline

#15 2015-02-13 00:12:17

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

I have created /espmp directory and mounted esp there. Updated /etc/fstab and chrooted. Reinstalled linux package and tryed to install gummiboot package (still fails and says that  File system /boot is not an EFI System Partition (ESP).).
But installing bootloader with command gummiboot --path=/efimp install gave the folloving:
Copied /usr/lib/gummiboot/gummibootx64.efi to /efimp/EFI/gummiboot/gummibootx64.efi.
Copied /usr/lib/gummiboot/gummibootx64.efi to /efimp/EFI/Boot/BOOTX64.EFI.
Created EFI boot entry "Linux Boot Manager".

arch.conf and loader.conf are at their location and contains needed lines as explained in Arch wiki.
I thought that everything fine: exit from chroot, rebooted. But sad Arch still was unable to boot with message Error loading \vmlinuz-linux: Volume Corrupt.
It seems I need to reformat /dev/sda3.

Offline

#16 2015-02-13 00:34:23

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

I did mkfs on /dev/sda3. pacman -S gummiboot was still failed. gummiboot --path=/efimp install was good.
I recreated arch.conf and loader.conf on /efimp, but now Arch Linux cannot load with

 Error loading \vmlinuz-linux: Not Found 

I changed path in arch.conf to /boot/vmlinuz-linux and also to /dev/sda10/vmlinuz-linux, but it did not found it there too.

Last edited by agent0 (2015-02-13 00:48:33)

Offline

#17 2015-02-13 00:43:43

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Windows sistematically corrupts my Linux loader

You probably need to  reinstall the kernel.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#18 2015-02-13 00:48:33

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Windows sistematically corrupts my Linux loader

The path is relative to the ESP.
gummiboot can only load kernels from the ESP.
You need to to copy the kernel and initramfs to the ESP.
There used to be a big wiki page about how to make copying automatic, but i can not find it right now.
EDIT:
Reinstalling the kernel does not work, as this does not copy the kernel to the ESP, only to /boot.

Last edited by teateawhy (2015-02-13 00:49:12)

Offline

#19 2015-02-13 00:58:27

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

teateawhy, you are probably about this https://wiki.archlinux.org/index.php/Gummiboot#Updating
OK, but if I will be able to copy kernels and initramfs from /boot to /efimp, I think Windows will corrupt them there. So I still will need to make recovery procedure. Am I right?

Offline

#20 2015-02-13 01:01:17

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: Windows sistematically corrupts my Linux loader

Your linux mount point of the efi partition does not matter for windows. Windows has acces to the efi partition and can mess around with it. Although it is very likely that the "fast boot" (not really shut down) windows feature caused the trouble.


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

#21 2015-02-13 01:29:32

agent0
Member
From: Russia
Registered: 2014-05-04
Posts: 74
Website

Re: Windows sistematically corrupts my Linux loader

Yes, I understand, that windows would not corrupt files in /boot. But due to gummiboot is able to load kernel only from esp (in my case from /efimp) and windows has access to it, I am wondering is it a reason for deviding kernel and esp to different partitions?

I disabled fast boot in Windows and can test if Windows will corrupt Linux loader.

Offline

#22 2015-02-13 02:02:43

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Windows sistematically corrupts my Linux loader

Offline

#23 2015-02-13 08:24:56

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: Windows sistematically corrupts my Linux loader

gummiboot can only boot kernel images (and initial ramdisks) located on the ESP.

It uses the partition type "EF00" to identify the ESP (as does your motherboard), check the type using:

# gdisk -l /dev/sd<x>

Arch mounts /boot on the ESP (rather than /boot/efi as all other distributions do) to allow the use of gummiboot or pure EFISTUB booting -- see the page linked by @teateawhy above.

Offline

#24 2015-02-13 10:36:48

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: Windows sistematically corrupts my Linux loader

I am a fan of refind as a bootloader. It does not have the limitation that gummiboot has. This makes it possible to have the kernel files on a linux file system and the ESP just contais the files refind needs and Windows' bootloader.
Windows cannot mess around with my kernel then.


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

Board footer

Powered by FluxBB