✓ Solved

How to extend disk with block storage

I've run out of sqlite database space. My current linode is 160GB but would like to increase that to 240GB. Can I use an 80GB volume to extend my existing space for the database, to a single continuous 240GB block of storage?

Would this mean creating a logical volume?

How?

2 Replies

✓ Best Answer

I've run out of sqlite database space. My current linode is 160GB but would like to increase that to 240GB.

That must be some sqlite3 database! I use sqlite all the time but none of mine are nowhere near that big. I would imagine that the performance is not that great but I don't know the characteristics of your app… sqlite databases are certainly easy to manage so I can also imagine that most of your hair is intact ;-)

Can I use an 80GB volume to extend my existing space for the database, to a single continuous 240GB block of storage?

No.

Would this mean creating a logical volume?

Yes.

How?

There are several LVM schemes available for Linux but virtually all of them alter the file system in such a way such that some standard Linode services (e.g., backups/snapshots) will not work (because the LVM file system is no longer ext3/ext4). None of them are easy to set up and all of them have quirks.

Using LVM increases the necessity of (file) backups because the LVM manager is free to store disc blocks as it sees fit…not necessarily how you would commonly think the file system would store them.

LVM is generally a $5 solution to a 25 cent problem given how cheap block storage is and how easy it is to integrate into an existing file system.

  • You need to always be on cruft patrol. Do you really need that 8 GiB, 1048576-color, every-pixel-is-precious, raw image of your high-school sweetheart on-line 24/7? This includes your database content…expired/cancelled accounts, etc.

  • You can allocate (let's say) a 100GiB volume and move your database there. You can then grow that at will by just making your block storage volume bigger and rebooting. Whatever free space on your "main" volume you may have left after moving your database off it can be de-allocated and reserved for restoring backups or snapshots.

  • You can definitely run a cron job that VACCUUMs the database periodically. That will recover some allocated but unused pages and defragment the database file. This is probably negligible for a database that big but it couldn't hurt. You can do VACUUM operations while the database is live outside your database app but it's probably best done while the database is write-locked or your app is shut down for other maintenance. You could also use the auto_vacuum PRAGMA…but that won't defragment the database file -- only reclaim unused space. See: https://www.techonthenet.com/sqlite/auto_vacuum.php

I hope this helps…

-- sw

Thanks for the extensive reply. Decided to do it the easier but more expensive way… upgrade the linode; at least for now.
It's actually two DBs one is test and the other is live. But they each take several days to build and both run at same time, as if they're live.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct