[NTLUG:Discuss] Software RAID using file "device"?

Stuart Johnston saj at thecommune.net
Fri Oct 21 17:36:42 CDT 2005


Chris Cox wrote:
> Stuart Johnston wrote:
> 
>>Drew Myers wrote:
>>
>>>* Stuart Johnston (saj at thecommune.net) wrote:
>>>
>>>
>>>>I have a server with two partitions, / and /home (not the best setup,
>>>>I know).  The /home partition is coming very close to running out of
>>>>disk space and I am trying to figure out a way to use some of the
>>>>extra space on / without requiring a trip down to the data center. 
>>>>This would only need to be a temporary solution.
>>>>
>>>>When I setup the system, I didn't worry too much about the partition
>>>>setup because I was using LVM, which I thought would allow me to
>>>>easily re-allocate the partitions as needed.  It turns out not to be
>>>>quite so easy since you can't generally resize an ext3 partition
>>>>while it is mounted.
>>>>
>>>>I was thinking about how in Linux, devices are treated like files and
>>>>you can often use them interchangeably.  So, if I created a file on /
>>>>then I could use it as a device in mdadm or lvm to combine linearly
>>>>with the /home partition (which can be unmounted and resized
>>>>remotely). Unfortuntately, neither mdadm nor lvm seem to be willing
>>>>to work with a non-block device.
>>>>
>>>>Any suggestions on how to make this work?
>>>
>>>
>>>What OS are you running?  In RHEL4 you can use the ext2online utility to
>>>resize the FS while it's mounted.
>>
>>ext2online will only expand, not shrink a mounted fs.  Thanks for the
>>suggestion though.  I didn't know RHEL4 (which this server is in fact
>>running) had that kernel patch.
> 
> 
> Also.. it implies growing the partition.  Sounds like LVM was not
> used... so unless you can shrink whatever and grab contiguous space next
> to the partition, you can't resize the parition.. and so you can't
> grow the filesystem.
> 
> I think the symlink idea is the the best approach.
> 
> Use LVM next time and create a volume group for the OS and
> a volume group for your user data.  Leave some room for
> growing the OS areas.

I did use LVM (see OP) but since I can't shrink the file system with the 
free space available (/), LVM doesn't help.  Now if I had created a 
large /tmp (for example), I'd be good to go.

Oh well, live and learn.

-Stuart




More information about the Discuss mailing list