How can I stop new data from being written to an XFS partition?

0
12
Asked By TechWhiz123 On

I'm managing a server with several XFS filesystems that range from 5 TB to 10 TB each. Right now, there's free space on these filesystems, and I want to prevent that space from being used without losing the ability to read and write the existing data. Unlike ext4, XFS can't be shrunk, and I can't just fill the partition with dummy files because I'm not allowed to add data to the filesystems. While I know that XFS quotas exist, the operating system and applications won't recognize them correctly, which would just cause a write error when the quota is reached. I'm looking for any alternative solutions. Would using sparse files be effective? I've also provided some context about my backup setup to explain why this matters. Essentially, I need to manage the balance of data across filesystems and ensure that the older, slower filesystems can't accept new data, so the backup solution will use the newer, optimized ones instead. Any advice?

5 Answers

Answered By UserFriendly On

I think you're seeing this as an XY problem. Instead of focusing on why to limit free space usage, why not explain the ultimate goal? If you're trying to migrate your backups to a new system, perhaps look for ways to configure your backup solution to directly migrate data rather than trying to block space. If it's set up to fill storage as it sees available space, maybe there’s a setting to prioritize which filesystems it uses?

Answered By BackUpBuddy On

Your backup solution's design should be fine-tuned to your needs. Trying to overflow the old filesystems so the new ones get used isn't the most straightforward. Why not present your need directly to the backup system support or community? They might have a better answer that doesn't rely on bending the filesystem's rules.

Answered By CloudRider42 On

It sounds like you want to prevent applications from adding new data but still allow them to modify existing files. If that’s the goal, one option might be to mount the filesystem as read-only, which stops any new data but allows you to access existing files without issues. But this may lock you out of making any changes to existing files, so keep that in mind!

Answered By DataGuru99 On

Using `fallocate` could be a workaround for your issue. It allows you to create a large file that essentially fills up the space on the filesystem, making it appear full to the applications. Just remember that sparse files don’t achieve what you're aiming for since they create the look of full usage without using any space. If your goal is to trick the system into seeing it as 'full', this could be your route!

Answered By SystemJunkie On

If your main worry is about read/write permissions, consider using Access Control Lists (ACLs). You could remove write permissions on the directories, which would prevent new file creation while still keeping existing files accessible. But, I can't help but feel like this approach could lead to some unnecessary complications. Maybe have a conversation with your users about limiting storage usage instead?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.