Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Mounting a disk image
PostPosted: Tue Nov 06, 2012 10:06 pm 
Offline
Senior Newbie

Joined: Tue Jan 24, 2012 8:02 pm
Posts: 7
Location: United Kingdom
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

Code:
/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

Code:
/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


Top
   
PostPosted: Wed Nov 07, 2012 11:23 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
You can't have xvda for every single disk image... You would have a different device for each image.


Top
   
PostPosted: Wed Nov 07, 2012 11:35 am 
Offline
Senior Newbie

Joined: Tue Jan 24, 2012 8:02 pm
Posts: 7
Location: United Kingdom
Oops - I was typing that too late at night :-)

That should have read:

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


Top
   
PostPosted: Thu Nov 08, 2012 9:23 am 
Offline
Senior Newbie

Joined: Tue Jan 24, 2012 8:02 pm
Posts: 7
Location: United Kingdom
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

Code:
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).
#
# <file system> <mount point> <type> <options> <dump> <pass>
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: mattltm and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group