]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - disk-utils/fdisk-menu.c
Merge branch 'PR/libmount-exec-errors' of github.com:karelzak/util-linux-work
[thirdparty/util-linux.git] / disk-utils / fdisk-menu.c
index 5cf00026ae377b5d8a2e0d6d16b9f2ea5073c09d..717554b0e3478d49e03a436086d61dbffa59c21d 100644 (file)
@@ -111,6 +111,8 @@ static const struct menu menu_generic = {
                MENU_ENT  ('t', N_("change a partition type")),
                MENU_BENT_E('v', N_("verify the partition table"), FDISK_DISKLABEL_BSD),
                MENU_ENT  ('i', N_("print information about a partition")),
+               MENU_ENT  ('e', N_("resize a partition")),
+               MENU_ENT  ('T', N_("discard (trim) sectors")),
 
                MENU_XENT('d', N_("print the raw data of the first sector from the device")),
                MENU_XENT('D', N_("print the raw data of the disklabel from the device")),
@@ -686,6 +688,9 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
                        rc = ask_for_wipe(cxt, partno);
                break;
        }
+       case 'e':
+               resize_partition(cxt);
+               break;
        case 't':
                change_partition_type(cxt);
                break;
@@ -710,6 +715,10 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
                        fdisk_unref_context(cxt);
                }
                break;
+       case 'T':
+               /* discard (trim) */
+               discard_sectors(cxt);
+               break;
        }
 
        return rc;