-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Sun, Aug 14, 2016 at 06:14:12PM -0700, zackp...@gmail.com wrote:
> On Saturday, August 13, 2016 at 5:45:58 PM UTC-4, Marek Marczykowski-Górecki 
> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> > 
> > On Sat, Aug 13, 2016 at 06:53:20AM -0700, zackp...@gmail.com wrote:
> > > On Saturday, August 13, 2016 at 6:14:44 AM UTC-4, Marek 
> > > Marczykowski-Górecki wrote:
> > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > Hash: SHA256
> > > > 
> > > > On Sat, Aug 13, 2016 at 03:11:57AM -0700, Andrew David Wong wrote:
> > > > > On 2016-08-12 20:57, zackp...@gmail.com wrote:
> > > > > > Hi all, I'm a new qubes user and have been following the guides to 
> > > > > > get
> > > > > > trim enabled for the dom0. Everything seems to have gone smoothly 
> > > > > > until the
> > > > > > grub steps. I can't find a grub.cfg file anywhere. The only 
> > > > > > abnormality to
> > > > > > my installation is that it's UEFI. So the closest thing I did find 
> > > > > > to this
> > > > > > was /boot/efi/EFI/qubes/xen.cfg which had the kernel line 
> > > > > > referenced in the
> > > > > > trim guide. However, when I attempt to run grub2-mkconfig -o 
> > > > > > /boot/efi/EFI/qubes/xen.cfg I get "grub2-mkconfig: command not 
> > > > > > found" All 
> > > > > > that is present in the /boot/grub2 folder is a themes folder. I am 
> > > > > > using
> > > > > > the main dom0 terminal for all of this.
> > > > > > 
> > > > > > Considering that everything boots fine, I'm hesitant to reinstall 
> > > > > > grub2 (I 
> > > > > > assume it would need to be grub2-efi in this case). Any clue as to 
> > > > > > what's 
> > > > > > going on? Thanks
> > > > > > 
> > > > > 
> > > > > I think grub2-mkconfig is not found because you're using UEFI rather 
> > > > > than
> > > > > legacy boot. Are you getting your instructions from here?
> > > > > 
> > > > > https://www.qubes-os.org/doc/disk-trim/
> > > > > 
> > > > > I think these instructions were written with legacy boot in mind. I'm 
> > > > > not sure
> > > > > how to enable TRIM on UEFI (CCing Marek).
> > > > 
> > > > Yes, on UEFI install /boot/efi/EFI/qubes/xen.cfg is the right file - you
> > > > need to edit it directly.
> > > > 
> > > > - -- 
> > > > Best Regards,
> > > > Marek Marczykowski-Górecki
> > > > Invisible Things Lab
> > > > A: Because it messes up the order in which people normally read text.
> > > > Q: Why is top-posting such a bad thing?
> > > > -----BEGIN PGP SIGNATURE-----
> > > > Version: GnuPG v2
> > > > 
> > > > iQEcBAEBCAAGBQJXrvMNAAoJENuP0xzK19csfqQH/0/P4FV8W2/pZhWaCeXfseqj
> > > > fw79GDTa5/ExjxSg4eehHDhHHVgG3kaeb0HafPvVnHS/DJuHzCG1Xrs1vyZJlPID
> > > > oCrH4FaaYQ2Che4L4D/Koh5lNEdEakKOrF7ILbTRN5u8Q4xvdM9KQ/paacCYkCDJ
> > > > YlYKELzyOZ1wkUvwttPynTANdrMlY797BHkHYHv2TbaMBTjw4EYmIs+VM9MRIWIv
> > > > Lis1hZn97y1z3ZIQglrQRCDLAmoNJPBsXRdMHjNyA5EeKQPX+fNxsE3/HIoqrIi3
> > > > 3DHYzKIS/UBDFHOJXj7I3pK311fS1IcUlrbRCXJYCM0gF5A5EkWKxIj0ghV0YTI=
> > > > =uhvX
> > > > -----END PGP SIGNATURE-----
> > > 
> > > So I'm editing the right file, that's all and good. Here's what I've done 
> > > so far: 
> > > 
> > > #Find UUID of ssd
> > > ls /dev/mapper/luks-*
> > > #Set trim in crypttab
> > > sudo nano /etc/crypttab
> > > #Add "allow-discards" at end of entry for ssd with matching UUID
> > > #Set trim in fstab
> > > sudo nano /etc/fstab
> > > #Add "discard" after other flags (like "default") for everything but swap
> > > sudo nano /etc/lvm/lvm.conf
> > > #Change "issue_discards" from "0" to "1"
> > > #Add discard to grub
> > > sudo nano /boot/efi/EFI/qubes/xen.cfg
> > > #At the end of the kernel line, add "rd.luks.allow-discards=1"
> > > #Rebuild initramfs
> > > sudo dracut -H -f
> > > ##Check if discard (trim) is enabled:
> > > lsblk -D
> > > #OR
> > > sudo dmsetup table
> > > 
> > > Everything above works except that lsblk still shows no trim support so I 
> > > guess that the rebuilding of grub is an important step in this.
> > 
> > I think dracut by default place output file in
> > /boot/initramfs-(kernel version), while on UEFI system bootloader loads
> > it from /boot/efi/EFI/qubes/. Try to copy it there.
> 
> I checked the date and time of creation of the initramfs file in the 
> directories you specified and you are correct in that dracut created it in 
> /boot. However, after copying it to /boot/efi/EFI/qubes and replacing the one 
> there, there's still no trim support. Here's my output:
> 
> sudo dmsetup table
> snapshot-fb01:3278378-fb01:3279033: 0 20971520 snapshot 7:7 7:8 P 256
> qubes_dom0-swap: 0 15990784 linear 251:0 2048
> qubes_dom0-root: 0 451420160 linear 251:0 15992832
> luks-07201718-857d-4108-a722-a5956c443e1e: 0 467421184 crypt aes-xts-plain64 
> 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
>  0 8:19 4096 1 allow_discards

The "allow_discards" is here, so it worked.

> snapshot-fb01:3278350-fb01:3278346: 0 20971520 snapshot 7:0 7:1 P 256
> 
> lsblk -D
> NAME                                       DISC-ALN DISC-GRAN DISC-MAX 
> DISC-ZERO
> sda                                               0      512B       2G        
>  0
> ├─sda1                                            0      512B       2G        
>  0
> ├─sda2                                            0      512B       2G        
>  0
> ├─sda3                                            0      512B       2G        
>  0
> └─sda4                                            0      512B       2G        
>  0
> sdb                                               0      512B       2G        
>  0
> ├─sdb1                                            0      512B       2G        
>  0
> ├─sdb2                                            0      512B       2G        
>  0
> └─sdb3                                            0      512B       2G        
>  0
>   └─luks-07201718-857d-4108-a722-a5956c443e1e
>                                                   0      512B       2G        
>  0
>     ├─qubes_dom0-root                             0      512B       2G        
>  0
>     └─qubes_dom0-swap                             0      512B       2G        
>  0

I don't see anything wrong here.
Just to be sure, you can trim empty space:

    sudo fstrim -v /

You should get info about trimmed space (and not an error).

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJXxOz5AAoJENuP0xzK19csjYMH/3sZUWL9qrwp0cy3rVZ6D46S
VT4fe5FOEceGbmmVKmDI7WIT8pF4PXT8gK9bsgHLcfy6CqfoLR0SwsbMgaWtp1WE
2qnBN8+gzgVlQUTSzTv/1LkhSH8J3+OsTu4ZidwuxMx9Ae8hrprjjNhsC7z5JOAD
kZwQQCN34voP9GJmEDMOxG2UebOI1bIHoPvyVsaPsoZLLNsBB5K2q4hxBGXCM6JX
eKSfbS65AowTrKk/ayQjJ5kuc/F2Clh6/rTd80kDy3gq5VVCpRWb5Z9vnVRTOIGZ
pgcPUX4W3P+IqZxFnymgavkApREVFjMlFzo5/2xP8uj0IAZiDvmnsIIKBxw/GXo=
=nlor
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/20160830021833.GK21245%40mail-itl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to