How to properly repair an encrypted 4fs Save file?
Posted: Sun 17 Mar 2013, 01:18
First an admission. I'm a noob. I'm still picking up things slowly. I've been fiddling with puppy linux since version 4.3 in the pre lucid days. *so I'm not a long time user.
The question is about 4fs save images. My problem is that once in a geat while I managed to lock up the machine and have to power off and on. When I do this I get inode errors and all manner of problems.
I'm using an IBM Thinkpad T60. I have a frugal installation of Slacko 5.4 My save file has the mild encryption and its in .4fs format. *So is everything. I chose 4fs because in some documentation its speaks of journaled file systems and how recovery is possible even in the event of power going off unexpectadly. I'm not sure how to access that feature. Instead I've read a number of threads that talk about using fsck or the new and improved e2fsck. When I've resorted to this I seem to make a bad problem much worse. I wrote up a Grub menu.lst file to let me boot up the above mentioned Slacko or a Lucid or Wary system. The lucid system got hung up I tried to fix it and that screwed it up totally so I deleted everything and never bothered to reinstall it
When my slacko system got munged I boot up Wary which I don't really use for daily use its just my emergency back up "boot"
After booting form Wary I thought this is where its ok to try to repair the Slacko Save file.
Step #1 I find the first available LOOP Device by doing this
losetup-FULL -f
The result in this case is loop2
Step #2 I do this to gives me some information on loop device 2
loseitup-FULL /dev/loop2
Step #3 I load the linux kernels crypto packages
modprobe cryptoloop
Step #4 I make a directory (No error if its already been done before)
mkdir -p /mnt/crypto
*Note I'm not sure why this is done. What is this going to be used for?
Step #5 I setup my encrypted save file to be accessable as loop2
losetup-FULL -e 1 /dev/loop2 /mnt/home/slacko5.4/pup_save_crypt.4fs
Step #6 I repair the encrypted loop2 (Which I think is the password open version of the puppysave.4fs file?)
# -b tells the program to use an alternative superblock.
# -p Automatic repair with no questions.
# -n Make no changes to the file system
# -y Answer yes to all questions.
# -c Check for bad blocks.
# -f Force checking even if the file system is marked clean.
# -v Give a lot of information, verbose.
e2fsck -v /dev/loop2
e2fsck tells me about a variety of inodes and files that should be this but are really that and so on. I hit "y" a lot and when its done and says everything is "ok" and I reboot.
The system is then totally unbootable and not at all useable so I cry and scream uselessly into the keyboard and start over from scratch.
Question 1. Something is not going right. Can anyone guide me to the correct solution to repair a slighltly munged up puppy save file in the future?
Question 2. If 4fs is a journaled file system what program / routine is used to make it "roll back" to a point where its not screwed up? e2fsck doesn't seem like the correct tool if I understand journaling *Which I probably don't.
Question 3. All I am trying to do with encrypting the frugal save file is keep the kids from booting up and messing around on the computer I use for work. Is there a better way to do this? *I'm thinking crypto is compliating this or maybe even part of the cause?
I've tried searching around for an answer but... The above is as close as I've gotten and I might not be understanding what I "think" I understand. If thats understandable...
The question is about 4fs save images. My problem is that once in a geat while I managed to lock up the machine and have to power off and on. When I do this I get inode errors and all manner of problems.
I'm using an IBM Thinkpad T60. I have a frugal installation of Slacko 5.4 My save file has the mild encryption and its in .4fs format. *So is everything. I chose 4fs because in some documentation its speaks of journaled file systems and how recovery is possible even in the event of power going off unexpectadly. I'm not sure how to access that feature. Instead I've read a number of threads that talk about using fsck or the new and improved e2fsck. When I've resorted to this I seem to make a bad problem much worse. I wrote up a Grub menu.lst file to let me boot up the above mentioned Slacko or a Lucid or Wary system. The lucid system got hung up I tried to fix it and that screwed it up totally so I deleted everything and never bothered to reinstall it
When my slacko system got munged I boot up Wary which I don't really use for daily use its just my emergency back up "boot"
After booting form Wary I thought this is where its ok to try to repair the Slacko Save file.
Step #1 I find the first available LOOP Device by doing this
losetup-FULL -f
The result in this case is loop2
Step #2 I do this to gives me some information on loop device 2
loseitup-FULL /dev/loop2
Step #3 I load the linux kernels crypto packages
modprobe cryptoloop
Step #4 I make a directory (No error if its already been done before)
mkdir -p /mnt/crypto
*Note I'm not sure why this is done. What is this going to be used for?
Step #5 I setup my encrypted save file to be accessable as loop2
losetup-FULL -e 1 /dev/loop2 /mnt/home/slacko5.4/pup_save_crypt.4fs
Step #6 I repair the encrypted loop2 (Which I think is the password open version of the puppysave.4fs file?)
# -b tells the program to use an alternative superblock.
# -p Automatic repair with no questions.
# -n Make no changes to the file system
# -y Answer yes to all questions.
# -c Check for bad blocks.
# -f Force checking even if the file system is marked clean.
# -v Give a lot of information, verbose.
e2fsck -v /dev/loop2
e2fsck tells me about a variety of inodes and files that should be this but are really that and so on. I hit "y" a lot and when its done and says everything is "ok" and I reboot.
The system is then totally unbootable and not at all useable so I cry and scream uselessly into the keyboard and start over from scratch.
Question 1. Something is not going right. Can anyone guide me to the correct solution to repair a slighltly munged up puppy save file in the future?
Question 2. If 4fs is a journaled file system what program / routine is used to make it "roll back" to a point where its not screwed up? e2fsck doesn't seem like the correct tool if I understand journaling *Which I probably don't.
Question 3. All I am trying to do with encrypting the frugal save file is keep the kids from booting up and messing around on the computer I use for work. Is there a better way to do this? *I'm thinking crypto is compliating this or maybe even part of the cause?
I've tried searching around for an answer but... The above is as close as I've gotten and I might not be understanding what I "think" I understand. If thats understandable...