Mounting a disk image

Hi

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

You can't have xvda for every single disk image… You would have a different device for each image.

Oops - I was typing that too late at night :-)

That should have read:

/dev/xvda Ubuntu
/dev/xvdb 512MB Swap Image
/dev/xvdc Storage

Oh wow - I've done it. I've no idea if I'm doing this the right way or the best way, but it works.

Create temp disk

Linode manager > Create a new disk image > Give it a name and keep it as type "ext3"

Assign the disk to Configuration Profile

Linode manager > Edit configuration profile > Block device assignment >

Select the name from the dropdown against /dev/xvdc

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

/dev/xvdc /test ext3 noatime,errors=remount-ro 0 1

(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

:D :D :D :D :D :D

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.

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