Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
hibernation on diskless machine - possible?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Sat Jan 31, 2009 9:35 pm    Post subject: hibernation on diskless machine - possible? Reply with quote

hi,

is it possible to have diskless (nfs root) machine that can hibernate? I think it would work, but I don't want to try and find out later that first couple times I got lucky and then, I'm out of luck and whole fs gets corrupted. I heard that hibernating with mounted readonly media can work (even if files change during sleep) if you sync and drop caches before suspending, would it work for things mounted rw (and being written all the time)?

thanks in advance.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23066

PostPosted: Sun Feb 01, 2009 1:15 am    Post subject: Reply with quote

It is acceptable to hibernate while a filesystem is mounted read-write if the hibernating machine is the only thing that writes to that filesystem, and thus the filesystem does not change between hibernation and resume. Since this restriction is imposed primarily by the fact that the hibernated image retains details about the filesystem, and does not discard them on resume, it might not apply for NFS mounted systems. The client can probably cope with the NFS server changing files while the client sleeps, since such changes can happen without notification while the client is awake, too. However, I have not tested this. What type of diskless system do you have that hibernation is worth the effort over a simple halt? Most diskless devices have such a simple purpose that rebooting them is an acceptable alternative.
Back to top
View user's profile Send private message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Sun Feb 01, 2009 12:10 pm    Post subject: Reply with quote

I put hdd from my desktop machine to my server (in another room) because it was too noisy. hibernation is nice for not losing all terminals with running things inside. so if I export on server my whole disk as a single mountpoint it should work? how would I secure it from other things on server? file permissions have to be not so secure, so that non-root users on client can work with them. how about other alternatives than nfs?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23066

PostPosted: Sun Feb 01, 2009 6:03 pm    Post subject: Reply with quote

Paczesiowa wrote:
so if I export on server my whole disk as a single mountpoint it should work?

Give it a try.
Paczesiowa wrote:
how would I secure it from other things on server?

You could use virtualization, paravirtualization, or possibly the namespace support.
Paczesiowa wrote:
file permissions have to be not so secure, so that non-root users on client can work with them.

Why do permissions need to be changed at all? If the client and server use the same user IDs, users should have access to the same content whether the disk is local or remote.
Paczesiowa wrote:
how about other alternatives than nfs?

Run VNC on the server, so all the terminals are on the server. Your desktop would run just an X server and VNC viewer, so there would be no meaningful state lost on shutdown. Alternately, get a quieter hard drive. This seems like a lot of work to combat a little noise pollution.
Back to top
View user's profile Send private message
jordanwb
l33t
l33t


Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Mon Feb 02, 2009 11:12 pm    Post subject: Reply with quote

How about using a flash drive for hibernation?
Back to top
View user's profile Send private message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Tue Feb 03, 2009 2:01 pm    Post subject: Reply with quote

you mean one of those ssds? can't afford one now unfortunately.

I'll try tonight with ata over ethernet - if I can get it to work there shouldn't be any corruption problems possible.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Tue Feb 03, 2009 2:26 pm    Post subject: Reply with quote

I think he meant a normal pendrive or a CF card.
Back to top
View user's profile Send private message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Tue Feb 03, 2009 3:20 pm    Post subject: Reply with quote

but how would I "use" it for hibernation? I'd have to put / and /home/ there, which would kill it pretty quickly.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Tue Feb 03, 2009 3:23 pm    Post subject: Reply with quote

You just make a swap partition and hibernate to it. (at least that's the basic idea...)
Back to top
View user's profile Send private message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Tue Feb 03, 2009 4:35 pm    Post subject: Reply with quote

it it not a technical problem with swap partition. the real problem is that my hibernated system has opened handles to files that can disappear after resume (that's why they tell you not to hibernate with mounted windows partition, if you are going to use windows. but it's much worse when you leave / mounted rw) or change location on disk layout and when I resume my new kernel will probably corrupt something.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Tue Feb 03, 2009 4:42 pm    Post subject: Reply with quote

How can an nfs share change the disk layout? Does it have a disk layout at all?
Back to top
View user's profile Send private message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Tue Feb 03, 2009 4:54 pm    Post subject: Reply with quote

I don't know and that's the problem:)
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Tue Feb 03, 2009 5:13 pm    Post subject: Reply with quote

What would happen if you just unmounted the share on hibernation and mounted on resume?
Back to top
View user's profile Send private message
Paczesiowa
Guru
Guru


Joined: 06 Mar 2006
Posts: 593
Location: Oborniki Śląskie, Poland

PostPosted: Tue Feb 03, 2009 5:29 pm    Post subject: Reply with quote

try it:>
umount /
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Tue Feb 03, 2009 6:33 pm    Post subject: Reply with quote

Yeah...basicaly that's why I used the "What would happen if ... ?" syntax :mrgreen:

But isn't it a bit different during hibernation?
Back to top
View user's profile Send private message
x22
Apprentice
Apprentice


Joined: 24 Apr 2006
Posts: 208

PostPosted: Wed Feb 04, 2009 11:15 am    Post subject: Reply with quote

Disk layout is controlled exclusively by NFS server so no FS corruption can happen this way.

What can happen is client seeing stale data or getting "ESTALE" errors. This risk can be eliminated if you make sure that the files which are mounted through NFS are not modified by the server or another NFS client.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Wed Feb 04, 2009 12:37 pm    Post subject: Reply with quote

So basicaly he needs to unmount all shares other than / /home etc. and keep the server on a UPS, right?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum