okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Kernel Panic

Fri Oct 23, 2015 9:28 pm

Hi,

my Raspberry suddenly talks to me like shown in https://onedrive.live.com/redir?resid=9 ... hoto%2cjpg. What can I do to get that machine back running without loosing my configuration?

Best regards,
Olaf

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Fri Oct 23, 2015 9:38 pm

You have a damaged filesystem on /dev/mmcblk0p2 (179,2). So you'll need to fsck that to get it back working.

Easiest way is boot a new SDCard and mount the broken card in a USB reader. You can then use sudo fsck -f -y /dev/sda2 to fix it. It's a good idea to keep a second bootable SDCard as a rescue system (or backup your live system on to it). I've got eight RPis, if I lose a filesystem I can use any one of the other RPis to rescue it. My USB reader cost £1 in the pound store.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Mon Oct 26, 2015 1:03 pm

Hi Dougie,

thanks for your reply and sorry for my delayed answer. More or less your solution fixed my issue. There was some additional trouble with "invalid magic numbers in the superblock" which I fixed with the efsck tool.
My Pi is not back in a stable state.

One additional question: Do you have some good resources on how to backup my RasPi-Image from the SD card during up-time of my Pi?

Best regards,
Olaf

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Mon Oct 26, 2015 1:56 pm

I back my systems up to a 2TB NAS (which is mounted as /shared on all of my RPis).

sudo dd if=/dev/mmcblk0 of=/shared/Raspi/backups/`uname -n`.`date +'%F'`.img bs=40M &
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Mon Oct 26, 2015 3:57 pm

Thanks, that sound like being a great path for me either. Only thing I have to get managed is mounting my QNAP to the pi filesystem...

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Mon Oct 26, 2015 4:54 pm

If your QNAP NAS supports NFS then switch to using that. NFS is a billion times easier to use with Linux than Samba/CIFS.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Mon Oct 26, 2015 5:31 pm

The QNAP is running a Linux on it. So I have to check how to create another partition with NFS.

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Kernel Panic

Mon Oct 26, 2015 5:38 pm

If the NAS is Linux, the filesystem on the partition is probably ext3 or ext4 - not that that matters much for the network file protocol being used.

Hopefully you should just be able to enable NFS access to the existing partition.

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Mon Oct 26, 2015 7:06 pm

Try using the showmount command with the IP address of your NAS.

pi@aplus ~ $ showmount -e 192.168.1.230
Export list for 192.168.1.230:
/i-data/xxxxxxxx/nfs/home 192.168.1.0/24
/i-data/xxxxxxxx/nfs/server 192.168.1.0/24
/i-data/xxxxxxxx/nfs/shared 192.168.1.0/24
pi@aplus ~ $
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Tue Oct 27, 2015 11:08 am

My NAS has two drives which are configured as a RAID 1 mirror. The RAID volume is ext4 file system.
I don't want to change the RAID configuration so I have to go with connecting a ext4 to my raspberry. Any ideas on that?

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Kernel Panic

Tue Oct 27, 2015 11:53 am

okoestner wrote: One additional question: Do you have some good resources on how to backup my RasPi-Image from the SD card during up-time of my Pi?

Best regards,
Olaf
I don't know if QNAP has it already, or if it can be installed, but if so I'd use rsync to back up. The initial backup takes a while of course, but my daily backup of "/" every morning only takes about 20 seconds using rsync. If I've installed some more software then it will take a little longer as it has a lot of new files to copy.

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Tue Oct 27, 2015 12:09 pm

Look at the user control panel on your NAS. There's a very high (better than evens) shot that it WILL support NFS as a file sharing system. Most NAS boxes that are built on Linux have that feature.

You will NOT have to reconfigure any part of your (hidden, under the covers) NAS filesystem structure to activate that.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Tue Oct 27, 2015 1:14 pm

Since there is already a lot of data on my NAS (QNAP TS-220) I assume building a new filesystem will cause me to format the drive. I don't want to do that.
What is the disadvantage going the way described in: http://geeks.noeit.com/mount-an-smb-net ... pberry-pi/

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Tue Oct 27, 2015 1:35 pm

The disadvantage are 1) the layers of code converting from Linux to CIFS on your NAS, CIFS to Linux on your RPi and 2) the complete lack of security. Security stops at the mount command.

It appears to be a control panel menu option to enable NFS.
http://docs.qnap.com/nas/4.0/en/index.h ... ac_nfs.htm

NO REFORMAT NEEDED!
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Tue Oct 27, 2015 3:30 pm

Wow... great!
I thought NFS to be another filesystem type.
NFS is now activated on my NAS. I will now have to check how to bind the NAS to my Pi.

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Tue Oct 27, 2015 3:56 pm

On your RPi run sudo apt-get install nfs-common rpcbind

Then run showmount --exports 192.168.nas.adr

That should give you something like
Export list for 192.168.nas.adr:
/i-data/xxxxxxxx/nfs/server 192.168.xxx.0/24
/i-data/xxxxxxxx/nfs/shared 192.168.xxx.0/24

You can then add those to your /etc/fstab

192.168.nas.adr:/i-data/xxxxxxxx/nfs/shared /shared nfs defaults,noatime,noauto,x-systemd.automount 0 0
192.168.nas.adr:/i-data/xxxxxxxx/nfs/server /server nfs defaults,noatime,noauto,x-systemd.automount 0 0

sudo /etc/init.d/rpcbind start
sudo mount /shared
sudo mount /server

gets them mounted without a reboot.

That "x-systemd.automount" stuff is needed to get Jessie with systemd to wait for the network to come up active before it tries to mount the shares. That means your NFS shares will be automagically mounted at reboot time.

On my NAS I even have /home mounted on a share.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Tue Oct 27, 2015 4:17 pm

thanks a lot for your support!!

I tried to do it the way you wrote, but:

mount.nfs: access denied by server while mounting 192.168.0.100:/raspi

On my NAS I applied permissions for some users and also (for testing purposes) full access for guest account.
On my raspi I created the /mnt/nas with chmod 777.

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Tue Oct 27, 2015 6:35 pm

okoestner wrote:
mount.nfs: access denied by server while mounting 192.168.0.100:/raspi
It's not filesystem permissions that need tweaking, it's NFS share permissions on your NAS. You have to open it to your whole LAN (or at least the static address for your RPi).
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Tue Oct 27, 2015 10:43 pm

Hmmm, have to figure out how to configure that in my QNAP. Up to know I did not find any configuration setting for that.

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Tue Oct 27, 2015 11:50 pm

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

okoestner
Posts: 42
Joined: Sat Aug 29, 2015 6:18 am

Re: Kernel Panic

Wed Oct 28, 2015 8:07 am

Great, it works... I figured out where the configure the NFS settings. It is a bit different than in the video you linked, but nevertheless I found it and I was able to configure it correctly.

Now my next step is to build the proper backup command and apply a cron job to do this daily...

User avatar
DougieLawson
Posts: 39302
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Kernel Panic

Wed Oct 28, 2015 10:14 am

I'm pleased it's worked for you, not bad considering I've not got a QNAP box, my NAS is a Zyxel.

For backup use rsync. rsync has the positive benefit that you only need to copy any of your data that's changed.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”