Hi All,
I have a fedora 30 bootable flash drive. /dev/sda5 is my "Linux Swap". To zero out my swap space to make it more friendly with gzip?
I would try just dd'ing /dev/zero across it, but I am afraid I might break some file structure or some other stuff.
Many thanks, -T
On 9/6/19 7:07 PM, ToddAndMargo via users wrote:
Hi All,
I have a fedora 30 bootable flash drive. /dev/sda5 is my "Linux Swap". To zero out my swap space to make it more friendly with gzip?
Should have said: How do I zero out
I would try just dd'ing /dev/zero across it, but I am afraid I might break some file structure or some other stuff.
Many thanks, -T
Found this:
Zeroing out FreeBSD swap space? https://unix.stackexchange.com/questions/219557/zeroing-out-freebsd-swap-spa...
Which said to just dd it. But it is for Free BSD, not Linux.
On 06Sep2019 19:07, ToddAndMargo ToddAndMargo@zoho.com wrote:
I have a fedora 30 bootable flash drive. /dev/sda5 is my "Linux Swap". To zero out my swap space to make it more friendly with gzip?
You could, you know, just skip that partition. Do distinct dds for each partition instead of the whole drive.
I would try just dd'ing /dev/zero across it, but I am afraid I might break some file structure or some other stuff.
Sure; Linux swap partitions have a little header. But it is transient data and unimportant. Zero it all. Run "mkswap" on the swap partition after restore before use. Or zero it, run mkswap, then dd, if you want a totally "clean" usable image file.
Also, stick a -v in your gzip, you'll get a report of overall compression achieved.
Cheers, Cameron Simpson cs@cskk.id.au
On 9/6/19 7:48 PM, Cameron Simpson wrote:
On 06Sep2019 19:07, ToddAndMargo ToddAndMargo@zoho.com wrote:
I have a fedora 30 bootable flash drive. /dev/sda5 is my "Linux Swap". To zero out my swap space to make it more friendly with gzip?
You could, you know, just skip that partition. Do distinct dds for each partition instead of the whole drive.
I would try just dd'ing /dev/zero across it, but I am afraid I might break some file structure or some other stuff.
Sure; Linux swap partitions have a little header. But it is transient data and unimportant. Zero it all. Run "mkswap" on the swap partition after restore before use. Or zero it, run mkswap, then dd, if you want a totally "clean" usable image file.
Also, stick a -v in your gzip, you'll get a report of overall compression achieved.
Cheers, Cameron Simpson cs@cskk.id.au
Hi Cameron,
The idea is to make a single big blast of the entire stick. This so I can restore it when Widows Nein (w10) corrupts it.
I try to remember to power off W-No before putting it in but I don't always remember and some time I forget to disable Fast Boot first, in which case Widows was never actually off and has at my drive.
Do I understand that dd'ing zeros across it will make it so I have to run mkswap after restoring?
How about running mkswap on it before dd'ing it?
Thank you for the help! -T
On 9/6/19 7:07 PM, ToddAndMargo via users wrote:
Hi All,
I have a fedora 30 bootable flash drive. /dev/sda5 is my "Linux Swap". To zero out my swap space to make it more friendly with gzip?
I would try just dd'ing /dev/zero across it, but I am afraid I might break some file structure or some other stuff.
Many thanks, -T
I found this:
# swapoff -a # swapon -a
But does it zero out the bits?
On 06Sep2019 20:57, ToddAndMargo ToddAndMargo@zoho.com wrote:
I found this:
# swapoff -a # swapon -a
But does it zero out the bits?
No, these just tell the kernel to not-use/use the swap areas.
Cheers, Cameron Simpson cs@cskk.id.au
On 06Sep2019 20:01, ToddAndMargo ToddAndMargo@zoho.com wrote:
Do I understand that dd'ing zeros across it will make it so I have to run mkswap after restoring? How about running mkswap on it before dd'ing it?
Either will do. You need to run mkswap after zeroing it and before using it for swap. Where the copy-to/from-the-image step sits in there is up to you:-)
Cheers, Cameron Simpson cs@cskk.id.au
if you reformat your swap partition you need adjust /etc/default/grub => new UUID from swap. a subsequent run of grub2-mkconfig is needed. OR you give the old UUID as parameter to mkswap -U (man mkswap)
btw: you're able to zero your swap part. with gnome disk => format => owerwrite existung data wirg zero
On 9/7/19 2:16 PM, sixpack13 wrote:
if you reformat your swap partition you need adjust /etc/default/grub => new UUID from swap. a subsequent run of grub2-mkconfig is needed. OR you give the old UUID as parameter to mkswap -U (man mkswap)
I was afraid of that. I will just suffer with it for now.
Thank you!