Bug 228461 - swapinfo(8) is not able to align the columns with longer names of devices
Summary: swapinfo(8) is not able to align the columns with longer names of devices
Status: Closed Feedback Timeout
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.1-STABLE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-24 14:28 UTC by vermaden
Modified: 2020-10-28 19:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vermaden 2018-05-24 14:28:31 UTC
It is now:

% swapinfo -h
Device          1K-blocks     Used    Avail Capacity
/dev/zvol/local/SWAP   4194304      12M     4.0G     0%

% swapinfo -m            
Device          1M-blocks     Used    Avail Capacity
/dev/zvol/local/SWAP      4096       11     4084     0%



Should be:

% swapinfo -h
Device                1K-blocks  Used  Avail  Capacity
/dev/zvol/local/SWAP    4194304   12M   4.0G        0%

% swapinfo -m            
Device                1M-blocks  Used  Avail  Capacity
/dev/zvol/local/SWAP       4096    11   4084        0%
Comment 1 vermaden 2019-10-14 13:12:07 UTC
Should I close that or leave it as it is?
Comment 2 Benedict Reuschling freebsd_committer 2019-11-12 18:40:21 UTC
It is definitely valid, especially when you have your swap on zvols and/or GELI encrypted swap. This easily overflows the space. Another misalignment happens when you have multiple swap providers, like a swap file or a swap area on each of many disks like this: 

$ swapinfo -h
Device          1K-blocks     Used    Avail Capacity
/dev/gpt/swap0.eli  16777216       0B      16G     0%
/dev/gpt/swap1.eli  16777216       0B      16G     0%
/dev/gpt/swap2.eli  16777216       0B      16G     0%
/dev/gpt/swap3.eli  16777216       0B      16G     0%
Total            67108864       0B      64G     0%

There is a patch in this PR here that might provide a solution:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223876