Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Jun 19, 2011 2:33 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Does anyone know how I can remount a read only disk image as read write without rebooting the linode?

I.e.

1. A disk image is created using the linode API as read only and the linode is then booted.
2. At some point write access is required so using the API write access is enabled
3. <run some command to tell the kernel the device is now writable>
4. write to image
5. mark as read only again
6. <run command to tell kernel it's now read only>

The obvious mount -o rw doesn't work.
I also gave restarting udev a try and using hdparm -r 0 /dev/<device> a try.

The hdparm appears to work until the device is unmounted then remounted any data written disappears.

I asked linode support they couldn't come up with anything maybe someone here has a creative idea?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sun Jun 19, 2011 5:14 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
I would be very surprised if you'll be able to do this; I suspect that the disk "attributes" aren't hot-changed on linode so you'd need to reboot to pick up the change (same as adding disks; it's not a hotplug event).

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
PostPosted: Sun Jun 19, 2011 11:17 pm 
Offline
Newbie

Joined: Thu Jun 16, 2011 2:25 am
Posts: 3
Website: http://www.greengecko.co.nz
AOL: steve@greengecko.co.nz
Location: Christchurch, New Zealand
Does the api mount the image as a loop device? If so, all bets are off...


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2011 7:59 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
The api doesn't mount the image you have to mount it yourself like a normal disk. It's not the end of the world if I have to reboot periodically it just would be nice not to have to.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2011 3:17 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
Can't you just leave it R/W at the Linode configuration level and control the R/O status only from within the guest environment? E.g., have your default fstab always mount it R/O and only switch to R/W when needed with the usual remount command?

I suppose this wouldn't be suitable if you're configuring it R/O at the host level due to distrusting the guest environment, but it wasn't clear if that was a requirement. Plus even that would be suspect if there was actually a way to reconfigure the host setup from within the guest.

-- David


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2011 3:19 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
db3l wrote:
Can't you just leave it R/W at the Linode configuration level and control the R/O status only from within the guest environment? E.g., have your default fstab always mount it R/O and only switch to R/W when needed with the usual remount command?

I suppose this wouldn't be suitable if you're configuring it R/O at the host level due to distrusting the guest environment, but it wasn't clear if that was a requirement. Plus even that would be suspect if there was actually a way to reconfigure the host setup from within the guest.

-- David


It's for aide. So yes distrusting the guest. So far as I know the only way to alter the host from the guest is via the API and the guest wouldn't have the API key. Currently I run aide over NFS but it's darn slow compared to running locally.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2011 4:33 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
obs wrote:
So far as I know the only way to alter the host from the guest is via the API and the guest wouldn't have the API key.

This is probably a bit extreme (or silly depending on your point of view), but we're already a bit paranoid by trying to protect the guest from itself, so...

Isn't the above a bit of a non-sequitur? If you want to alter the host from the guest using the API, then the guest does have to have the API key, even if it's just while you type it in to run the script. So if the worry is the guest being compromised I'm not sure I'd want to introduce the key into the environment at all, especially since if compromised it exposes much more than just the guest environment.

So at that point making the change externally and rebooting the guest seems much safer anyway, albeit less convenient. Or actually, maybe best is having a completely separate profile to use the disk R/W, so it's never exposed R/W to the risky guest and all changes are made by booting temporarily into a different environment.

-- David


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2011 4:41 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
I didn't say the guest edited the host via the api, I just said I used the api since that's the only way of making read only images. The host would be modified externally.
The issue is once the host has been modified externally to allow the image to be written to I can't figure out how to get the guest to then write to it without rebooting.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2011 5:17 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
obs wrote:
I didn't say the guest edited the host via the api, I just said I used the api since that's the only way of making read only images. The host would be modified externally.

Oops - sorry, I think I got confused by your phrase of "alter the host from the guest" to imply that's what you wanted to do as opposed to what you knew couldn't happen. My bad and please ignore the non-sequitur comment :-)

-- David


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


Who is online

Users browsing this forum: No registered users and 6 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