Different file systems, same partition. Practical?
I've inherited a machine with everything in just one partition on an ext3 filesystem. I'd now like to set some of the disk up as XFS or BTRFS, and though I can see that I can do that by using a liveCD when / is not mounted, I was wondering whether the following is a practical alternative. I can set aside a part of the h/d and set it up with my chosen filesystem doing (for approximately 1GB size) :
$ dd if=/dev/zero of=target.img bs=1024 count=1000000
$ mkfs.xfs target.img
$ mkdir portal
$ mount -o loop storage portal
I can now access the new (in this case) XFS filesystem through the directory "portal", and indeed it shows up as a separate "partition" via "df -h", i.e:
$ df -h
Filesystem Size Used Avail Use% Mounted on
<... snip ..>
/dev/loop0 996M 26M 971M 3% /disk2/test/portal
and it's the required file system type:
$ file storage
storage: SGI XFS filesystem data (blksz 4096, inosz 256, v2 dirs)
My question is: Have I set myself up for a fall by doing this, or is it a valid way to make available a different type of file system without repartitioning the disk?