Bug #7451

Grub snapshots not cleaned up after deleting boot environments from GUI.

Added by titan_rw - over 5 years ago. Updated about 3 years ago.

Closed: Not To Be Fixed
Nice to have
Sean Fagan
Target version:
Seen in:
Reason for Closing:
Reason for Blocked:
Needs QA:
Needs Doc:
Needs Merging:
Needs Automation:
Support Suite Ticket:
Hardware Configuration:
ChangeLog Required:



I got around to cleaning up some of my boot environments that had accumulated over time. In the web gui I deleted all but the latest two boot environments. I used to have around 25 as this particular nas had been running 9.3 from pre-beta days.

This seemed to delete the 'freenas-boot/ROOT' clones and snapshots, but there are still all the 'freenas-boot/grub@xxxxxx' snapshots. I realize these don't take much space as the grub dataset is pretty small, and not much changes in there from release to release, but I would have thought deleting the boot environment would have deleted the corresponding grub snapshot too.

Am I misinformed and this is expected behavior?

See below:

root@nas2 ~ # zfs list -t all -r freenas-boot
NAME                                                                    USED  AVAIL  REFER  MOUNTPOINT
freenas-boot                                                           1.22G  27.6G    31K  none
freenas-boot/ROOT                                                      1.18G  27.6G    31K  none
freenas-boot/ROOT/FreeNAS-9.3-STABLE-201412312006                        79K  27.6G   932M  /
freenas-boot/ROOT/FreeNAS-9.3-STABLE-201501090144                      1.18G  27.6G   932M  /
freenas-boot/ROOT/FreeNAS-9.3-STABLE-201501090144@2015-01-09-12:35:32   281M      -   932M  -
freenas-boot/grub                                                      25.2M  27.6G  7.78M  legacy
freenas-boot/grub@Pre-Upgrade-FreeNAS-1415148344                       32.5K      -  7.77M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-1415401367                       36.5K      -  7.78M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-1415406090                       40.5K      -  7.78M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1416270131-1            44.5K      -  7.79M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1416348004                49K      -  7.79M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1416462961                53K      -  7.79M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1416522377                57K      -  7.80M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1416634263-1              61K      -  7.80M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1416953840              65.5K      -  7.81M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1416961599              69.5K      -  7.81M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1416964242              73.5K      -  7.81M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1417106687                78K      -  7.82M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1417305865                82K      -  7.82M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-1417449978                86K      -  7.83M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-FreeNAS-9.3-BETA-201412032320    90.5K      -  7.83M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-201412060221            94.5K      -  7.84M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-BETA-201412071659              98K      -  7.84M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201412090314           102K      -  7.84M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201412091831           106K      -  7.85M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201412142326           110K      -  7.85M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201412200530           115K      -  7.86M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201412240734           119K      -  7.86M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201412300101           124K      -  7.86M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201412312006          7.81M      -  7.82M  -
freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201501090144           132K      -  7.87M  -


#1 Updated by Sean Fagan over 5 years ago

  • Category set to 1
  • Status changed from Unscreened to Screened
  • Assignee set to Sean Fagan
  • Target version set to Unspecified

I think it needs to stop doing them, as there's not really a way to do anything with them.

The grub snapshots are not part of the boot environment; they were there for safety. But, as I said, not much to do with them.

This is a relatively low priority, but I have been thinking about it.

#2 Updated by titan_rw - over 5 years ago

Ahh, so they're created during the upgrade process, but aren't used even if the user reverts to a previous boot environment?

I assume they're safe to 'zfs destroy' manually then?

I agree, very low priority. "usedbysnapshots" is only 17M.

#3 Updated by Sean Fagan over 5 years ago

Yes, completely safe to destroy.

#4 Updated by Arwen Evenstar over 4 years ago

Sean Fagan wrote:

Yes, completely safe to destroy.

I've just seen these as well, and was going to report it. But, this bug covers
it. To be clear to others, there are no pre-req ZFS destroys. Simply;

# zfs destroy freenas-boot/grub@Pre-Upgrade-FreeNAS-9.3-STABLE-201503150158

And repeat as desired.

#5 Updated by Sean Fagan over 4 years ago

I changed it in FN10 to not create it.

You can clean them all up by doing

zfs list -t snapshot -d 1 -r freenas-boot/grub | grep Pre-Upgrade | cut -f1 -d' ' | xargs -n 1 zfs destroy

Keeping this open in case we need to automatically clean them up, but that's basically what it'd do.

#6 Updated by Jordan Hubbard over 4 years ago

  • Status changed from Screened to Closed: Not To Be Fixed

Timing out and closing.

#7 Avatar?id=14398&size=24x24 Updated by Kris Moore about 3 years ago

  • Target version changed from Unspecified to N/A

Also available in: Atom PDF