Mounting a disk image
I'm trying to create a storage space outside of my main disk image.
I've created a blank disk image for this called "Storage"
I've now created a Configuration Profile with the following block device assignemnts
/dev/xvda Ubuntu
/dev/xvda 512MB Swap Image
/dev/xvda Storage
Ubuntu starts just fine, but I don't know how to mount "Storage"
If I run a mount command, I get
/dev/xvda on / type ext3 (rw,noatime,errors=remount-ro)
proc on /proc type proc (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
devtmpfs on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
Please could anyone help me add the storage that sits outside of the O/S to this system?
Cheers
Jibb
3 Replies
That should have read:
/dev/xvda Ubuntu
/dev/xvdb 512MB Swap Image
/dev/xvdc Storage
Create temp disk
Linode manager > Create a new disk image > Give it a
Assign the disk to Configuration Profile
Linode manager > Edit configuration profile > Block device assignment >
Select the
Edit fstab
Make a backup copy of your /etc/fstab
Edit /etc/fstab with nano
nano /etc/fstab
Add the line highlighted red
root@test:/test# cat /etc/fstab
/etc/fstab: static file system information.
#
Use 'blkid' to print the universally unique identifier for a
device; this may be used with UUID= as a more robust way to name devices
that works even if disks are added and removed. See fstab(5).
#
proc /proc proc defaults 0 0
/dev/xvda / ext3 noatime,errors=remount-ro 0 1
/dev/xvdb none swap sw 0 0
(I have set this to mount as /test by default
Save the file and reboot your linode
Mount the device
mount /dev/xvdc /test
Done
You now have a storage area that sits outside of your operating system, so you can back files up here and trash the O/S
I'm not very experienced with Linux, so I've no doubt that there are better ways of doing this - but this seems easy and works for me.