12

This is kind of a continuation of - How to get free space from mounted drive Redhat 7

The problem I am facing is when i run:

[root@x011dc01-rhtest /]# fstrim -v /

I get the following error:

fstrim: /: the discard operation is not supported

Googling all day has always had one common theme.

Update the /etc/crypttab to something similar to this:

[root@noteloek ~]# cat /etc/crypttab 
luks-2OHGU8-ir1w-LLGB-6v72-zZqN-CIaX-FjGImJ UUID=2OHGU8-ir1w-LLGB-6v72-zZqN-CIaX-FjGImJ none allow-discards

What happens is after I update this file and i run "dracut -f" as well as "dracut --force -I /etc/crypttab" then i reboot. The system will come up and ask for a passphrase, which it seems i can enter any random string and it will let me go through.

I did find an article about adding a key file but im not really sure about that.

I do not want to get locked out of the system, also i really have no idea what im doing.

Some information that might be helpful.

One of many articles I am following about how to enable fstrim

https://blog.christophersmart.com/2013/06/05/trim-on-lvm-on-luks-on-ssd/

This looks good:

[root@x011dc01-rhtest /]# cat /etc/fstab | grep root
/dev/mapper/rhel_x011dc01--rhtest-root /                       xfs     defaults,discard        1 2

[root@x011dc01-rhtest /]# cat /etc/lvm/lvm.conf | grep 'issue_discards'
    # Configuration option devices/issue_discards.
    issue_discards = 1

Now even after i update the /etc/crypttab and update the system and reboot, when it asks for the passphrase I will enter it login and still I will get the same exact error.

fstrim: /: the discard operation is not supported

I have tried changing luks,discard to allow-discards no effect.

I am not against trying to configure a passphrase key thing, however if it is still not working i dont want to go through the trouble.

I have updated my

    [root@x011dc01-rhtest /]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.luks.allow-discards=luks-2OHGU8-ir1w-LLGB-6v72-zZqN-CIaX-FjGImJ rd.luks.uuid=luks-2OHGU8-ir1w-LLGB-6v72-zZqN-CIaX-FjGImJ vconsole.font=latarcyrheb-sun16 vconsole.keymap=us $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

And then running this to..... do something:

grub2-mkconfig -o /boot/grub2/grub.cfg

Also probably worth noting what is going in my head.

[root@x011dc01-rhtest /]# blkid
**/dev/block/8:2: UUID="2OHGU8-ir1w-LLGB-6v72-zZqN-CIaX-FjGImJ" TYPE="LVM2_member"**
/dev/block/253:1: UUID="ad872f09-5147-4252-af56-aa6244219515" TYPE="xfs"
/dev/block/8:1: UUID="83aac355-a443-4ff9-90fa-9f6da8e31cc2" TYPE="xfs"
/dev/block/253:0: UUID="dbe56f6a-2a4a-42da-82e2-bef9a73caafb" TYPE="swap"


[root@x011dc01-rhtest /]# lsblk
NAME                           MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0                              2:0    1    4K  0 disk
sda                              8:0    0   50G  0 disk
ââsda1                           8:1    0  500M  0 part /boot
**ââsda2**                           8:2    0 49.5G  0 part
  âârhel_x011dc01--rhtest-swap 253:0    0    2G  0 lvm  [SWAP]
  **âârhel_x011dc01--rhtest-root 253:1    0 47.5G  0 lvm  /**
sdb                              8:16   0   50G  0 disk
sr0                             11:0    1 1024M  0 rom

What i want to be able to do is run fstrim on the "/" only so i am using So i am using the UUID="2OHGU8-ir1w-LLGB-6v72-zZqN-CIaX-FjGImJ"

[root@x011dc01-rhtest /]# blkid /dev/sda2
/dev/sda2: UUID="2OHGU8-ir1w-LLGB-6v72-zZqN-CIaX-FjGImJ" TYPE="LVM2_member"

This is my fstab

[root@x011dc01-rhtest /]# cat /etc/fstab

**/dev/mapper/rhel_x011dc01--rhtest-root /                       xfs     defaults,discard        1 2**
UUID=83aac355-a443-4ff9-90fa-9f6da8e31cc2 /boot                   xfs     defaults        0 0
/dev/mapper/rhel_x011dc01--rhtest-swap swap                    swap    defaults        0 0

Anthony else I can add that might be helpful please let me know.

Anthony Fornito
  • 9,526
  • 1
  • 33
  • 122
  • 1
    Why do you think `/etc/crypttab` has any relevance here? You don't appear to have any encrypted volumes. – Michael Hampton Oct 20 '16 at 15:54
  • The only reason being that many of the articles I have seen all say to change the /etc/crypttab file. It seems that no matter what I do there doesn't seem to be any change on the machine. – Anthony Fornito Oct 20 '16 at 16:22
  • 1
    Well, it certainly doesn't look relevant, but you did forget to describe the server. – Michael Hampton Oct 20 '16 at 16:24
  • The server is a vm running on ESXi 6 and Par3 san. uname = Linux x011dc01-rhtest.com 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux other than that what info would you need? – Anthony Fornito Oct 20 '16 at 16:29
  • If you google something along the lines of "fedora fstrim the discard operation is not supported no encryption" you will see that every article says you need to update the /etc/crypttab file – Anthony Fornito Oct 20 '16 at 16:32
  • Why are you trying to use trim in a VM? What is the **real problem** you are trying to solve here? – Zoredache Oct 20 '16 at 16:34
  • The real problem is if you refer to http://serverfault.com/questions/809809/how-to-get-free-space-from-mounted-drive-redhat-7 the post i create i need to find something similar to sdelete only for linux. i tried to run the dd=somethingsomething and while the file was being create my disk I/O when through the roof and my CIO was not happy. Also it took about 2 hours before i had to kill it. So then i found this fstrim but cannot get it working. – Anthony Fornito Oct 20 '16 at 16:41
  • Ah, sorry I missed the link to the original post. So you say `One of articles ... about how to enable fstrim` - that article mentions right in the title it only applies if you are using LUKS. You are not using LUKS/dm-crypt. The article does not apply to you. – Zoredache Oct 20 '16 at 17:06
  • So is your storage thin provisioned? – Michael Hampton Oct 20 '16 at 17:07
  • Funny thing on the thin provisioning. When i started out on this, I assumed without asking the VM guys, that it was thin provisioned. Turns out no they are Think provisioned. When i asked why it makes a difference they told me something about how 3par will only give the VM what it needs, which I will be honest didn't sound right nor make any sense. I do not know enough about 3par to back up my thoughts. – Anthony Fornito Oct 20 '16 at 17:20

1 Answers1

0

When storage is provided by a remote server across a SAN, you can only discard blocks if the storage is thin provisioned. If the storage is thick provisioned, it is always the same size, and discard makes no sense (and thus isn't usable).

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • Mike i agree with you answer, however the VMware team is telling me something different. Let talk with them again to get an understanding of why they think this needs to be done. I also need to educate myself on the process. – Anthony Fornito Oct 20 '16 at 17:52