Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] how to check if Linux is hibernated
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
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2670
Location: Hamburg/Germany

PostPosted: Fri Sep 14, 2012 4:15 pm    Post subject: [solved] how to check if Linux is hibernated Reply with quote

? I accidentely chrooted into such an image and could now repair the filesystem ... :-(

(I'm looking for a equivalent to my NTSF solution :
Code:
[[ "$(ntfscat /dev/sda1 hiberfil.sys | head -n 1 | cut -c1-4)" = "hibr" ]] &&


Last edited by toralf on Sat Sep 15, 2012 10:16 am; edited 1 time in total
Back to top
View user's profile Send private message
piedar
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2010
Posts: 80

PostPosted: Sat Sep 15, 2012 6:00 am    Post subject: Reply with quote

On my system, where /dev/sdb5 is a swap partition with a hibernated image
Code:
head -n 1 /dev/sdb5

contains the string SWAPSPACE2S1SUSPEND
However, if I pipe it into cut, cut chokes on the binary characters. There's probably another tool that can process it, dd maybe?


Last edited by piedar on Sat Sep 15, 2012 3:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2670
Location: Hamburg/Germany

PostPosted: Sat Sep 15, 2012 9:41 am    Post subject: Reply with quote

interesting, I'll try something like
Code:
head -n 1 /dev/sdb2 | strings | grep SWAPSPACE2S1SUSPEND
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