Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Remove swap from /dev/md2 ?

dIsKdIsK Barred

Hi,
i can not figure out how can i claim space/remove/delete swap from /dev/md2 ?

cat /etc/fstab
UUID=bla-bla-bla-bla-bla none swap sw 0 0

I need it to remove as i have 64GB ram and i need some space as root is full :D

/dev/md1 405G 392G 0 100% /

Please if you can point me to some tutorial or so, thanks :)

Comments

  • FalzoFalzo Member
    edited November 2024

    I would recommend to first run something like tune2fs -m 1 to reclaim some reserved space. also check logfiles directory and journald for what claims that space and if you can quickly get some breathing room.

    rather delete a few GB of your p*rn instead of trying to cram even more on that poor system. can be a temporary solution only anyway, as this system obviously is at its limits already.

    however, for removing swap:

    mdadm -D /dev/md2 to ensure that indeed is your swap, this will also reveal which partitions are used on it

    swapoff -a to turn of the use as swap, after that you can remove the fstab entry (or comment it out)

    from here on you have to decide, what you actually want to do with the free space. adding it directly to root means that you need to grow the raid array. can be done online, but will lead to resync and such. make sure you have backups to not have be sorry afterwards.

    use something like parted to delete the partitions that have been used for swap and resize your root partitions to add the space there.

    this will only work, if the swap partition are behind the root, but from md1 vs md2 it can probably be assumed, that this is the case.

    mdadm --grow --size max /dev/md1 after both partitions have been resized, to resize the raid to the max size.

    this will make the array resync, I'd usually recommend waiting for that to finish.

    resize2fs /dev/md1 then finally should grow also your root fs to the full size

    no guarantues, use at your own risk and if in doubt or unclear what this all does better DO NOT. don't come back whining, if anything broke. you have been warned ;-)

    Thanked by 1dIsK
  • dIsKdIsK Barred
    edited November 2024

    thanks! i am noob in raid and oops, meanwhile i removed swap from what appeared to be mounted on /dev/sdd4 and /dev/sdh4, removed via fdisk "d" (rebooted it and server booted, swap is not here shown via for example htop command)...

    also removed rm -rf /dev/md2

    but nothing works, still no space available

    mdadm -D /dev/md2
    mdadm: cannot open /dev/md2: No such file or directory
    

    its deleted so i am probably fked up?

    mdadm --grow --size max /dev/md1
    mdadm: Cannot set device size in this type of array.
    
    resize2fs /dev/md1
    resize2fs 1.45.5 (07-Jan-2020)
    The filesystem is already 107816448 (4k) blocks long.  Nothing to do!
    
  • you need to resize the partitions that build your md1 array before you can grow it. how many disk are in this server and what type of raid is md1 anyway?

    fdisk cannot resize partitions easily. parted can.

    did you make backups? maybe it's easier to reinstall your system with partitioning it to your likings and moving your data back in afterwards. probably safer than fiddling around with it online and without knowledge of what you actually are doing...

Sign In or Register to comment.