# hibernation on diskless machine - possible?

## Paczesiowa

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.

----------

## Hu

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.

----------

## Paczesiowa

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?

----------

## Hu

 *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.

----------

## jordanwb

How about using a flash drive for hibernation?

----------

## Paczesiowa

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.

----------

## szczerb

I think he meant a normal pendrive or a CF card.

----------

## Paczesiowa

but how would I "use" it for hibernation? I'd have to put / and /home/ there, which would kill it pretty quickly.

----------

## szczerb

You just make a swap partition and hibernate to it. (at least that's the basic idea...)

----------

## Paczesiowa

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.

----------

## szczerb

How can an nfs share change the disk layout? Does it have a disk layout at all?

----------

## Paczesiowa

I don't know and that's the problem:)

----------

## szczerb

What would happen if you just unmounted the share on hibernation and mounted on resume?

----------

## Paczesiowa

try it:>

umount /

----------

## szczerb

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

But isn't it a bit different during hibernation?

----------

## x22

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.

----------

## szczerb

So basicaly he needs to unmount all shares other than / /home etc. and keep the server on a UPS, right?

----------

