Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need help to work out what damage I have done to my Ubuntu server.

I ran a poorly coded script which has overwritten 26 files on my Ubuntu server. The script used sudo to run with root permissions to copy files from my Raspberry Pi box.

There is nothing noticeably wrong with the Ubuntu server at the moment - it is operating fine currently in headless mode - but can anyone give my any advice as to what the files I have changed do and how I might put them back, if necessary?

I am especially worried about the files in the /boot directory. I worry that I may have left the Ubuntu server unable to reboot.

The files that were overwritten are:

-rwxr-xr-x 1 root root 17824 Apr  9 14:08 /boot/bootcode.bin
-rwxr-xr-x 1 root root 142 Feb  9  2013 /boot/cmdline.txt
-rwxr-xr-x 1 root root 1191 May 19  2013 /boot/config.txt
-rwxr-xr-x 1 root root 5783 Apr  9 14:08 /boot/fixup.dat
-rwxr-xr-x 1 root root 2068 Apr  9 14:08 /boot/fixup_cd.dat
-rwxr-xr-x 1 root root 8829 Apr  9 14:08 /boot/fixup_x.dat
-rwxr-xr-x 1 root root 3115216 Apr  9 14:08 /boot/kernel.img
-rwxr-xr-x 1 root root 9789752 Apr  9 14:08 /boot/kernel_emergency.img
-rwxr-xr-x 1 root root 2514136 Apr  9 14:08 /boot/start.elf
-rwxr-xr-x 1 root root 480216 Apr  9 14:08 /boot/start_cd.elf
-rwxr-xr-x 1 root root 3495816 Apr  9 14:08 /boot/start_x.elf
-rwxr-xr-x 1 root root 137 Feb  9  2013 /boot/issue.txt
-r--r--r-- 1 root root 0 Apr 16 09:22 /dev/sndstat
-rw-r--r-- 1 root root 0 Apr  9 12:17 /run/shm/.tmpfs
-rwxr-xr-x 1 root root 53293 Sep  9  2012 /dev/MAKEDEV
-rwxr-xr-x 1 root root 53293 Sep  9  2012 /sbin/MAKEDEV
-rwxr-xr-x 1 root root 227868 Jul  2  2012 /sbin/tc
drwxr-xr-x 2 root root 4096 Jan 18 19:19 /usr/lib/tc
lrwxrwxrwx 1 root root 6 Mar 30  2012 /sbin/swapoff -> swapon
lrwxrwxrwx 1 root root 10 Nov 20  2011 /sbin/lsmod -> /bin/lsmod
-rwxr-xr-x 1 root root 75868 Apr 29  2013 /bin/lsmod
lrwxrwxrwx 1 root root 13 Mar  7  2013 /sbin/ip6tables-save -> xtables-multi
-rwxr-xr-x 1 root root 24488 Jul  2  2012 /sbin/rtacct
-rwxr-xr-x 1 root root 26176 Aug 11  2012 /sbin/ntfslabel
-rwxr-xr-x 1 root root 93148 Dec 22  2012 /sbin/fdisk
-rwxr-xr-x 1 root root 30332 Dec 22  2012 /sbin/mkfs.cramfs

As requested, here is a list of all the files that are now in /boot:

-rw-r--r--  1 root root   178944 Nov 27  2011 memtest86+_multiboot.bin
-rw-r--r--  1 root root   176764 Nov 27  2011 memtest86+.bin
-rwxr-xr-x  1 root root      142 Feb  9  2013 cmdline.txt
-rwxr-xr-x  1 root root      137 Feb  9  2013 issue.txt
-rwxr-xr-x  1 root root     1191 May 19  2013 config.txt
-rw-------  1 root root  5453616 Jan 30 17:47 vmlinuz-3.8.0-35-generic
-rw-------  1 root root  3192757 Jan 30 17:47 System.map-3.8.0-35-generic
-rw-r--r--  1 root root   154959 Jan 30 17:47 config-3.8.0-35-generic
-rw-r--r--  1 root root   919810 Jan 30 17:47 abi-3.8.0-35-generic
-rw-------  1 root root  5454928 Feb  3 22:19 vmlinuz-3.8.0-36-generic
-rw-------  1 root root  3192822 Feb  3 22:19 System.map-3.8.0-36-generic
-rw-r--r--  1 root root   154959 Feb  3 22:19 config-3.8.0-36-generic
-rw-r--r--  1 root root   919810 Feb  3 22:19 abi-3.8.0-36-generic
-rw-r--r--  1 root root 20324962 Feb 16 07:02 initrd.img-3.8.0-35-generic
-rw-r--r--  1 root root 20329365 Feb 19 06:39 initrd.img-3.8.0-36-generic
-rw-------  1 root root  5458256 Feb 19 21:52 vmlinuz-3.8.0-37-generic
-rw-------  1 root root  3194987 Feb 19 21:52 System.map-3.8.0-37-generic
-rw-r--r--  1 root root   154970 Feb 19 21:52 config-3.8.0-37-generic
-rw-r--r--  1 root root   920492 Feb 19 21:52 abi-3.8.0-37-generic
-rw-------  1 root root  5457776 Mar 13 16:46 vmlinuz-3.8.0-38-generic
-rw-------  1 root root  3195003 Mar 13 16:46 System.map-3.8.0-38-generic
-rw-r--r--  1 root root   154970 Mar 13 16:46 config-3.8.0-38-generic
-rw-r--r--  1 root root   920492 Mar 13 16:46 abi-3.8.0-38-generic
-rw-r--r--  1 root root 20328592 Mar 25 06:44 initrd.img-3.8.0-37-generic
drwxr-xr-x 23 root root     4096 Apr  4 06:41 ..
drwxr-xr-x  3 root root    12288 Apr  4 06:42 grub
-rw-r--r--  1 root root 20667791 Apr  9 13:44 initrd.img-3.8.0-38-generic
-rwxr-xr-x  1 root root    17824 Apr  9 14:08 bootcode.bin
-rwxr-xr-x  1 root root     5783 Apr  9 14:08 fixup.dat
-rwxr-xr-x  1 root root     2068 Apr  9 14:08 fixup_cd.dat
-rwxr-xr-x  1 root root  3115216 Apr  9 14:08 kernel.img
-rwxr-xr-x  1 root root     8829 Apr  9 14:08 fixup_x.dat
-rwxr-xr-x  1 root root  9789752 Apr  9 14:08 kernel_emergency.img
-rwxr-xr-x  1 root root  2514136 Apr  9 14:08 start.elf
-rwxr-xr-x  1 root root   480216 Apr  9 14:08 start_cd.elf
-rwxr-xr-x  1 root root  3495816 Apr  9 14:08 start_x.elf
drwxr-xr-x  3 root root     4096 Apr  9 14:08 .
share|improve this question
    
Could you show the current content of your /boot directory? –  terdon Apr 16 at 10:14

1 Answer 1

The good news is that all of the files in /boot are specific to raspbian and aren't present on a typical Ubuntu install. I don't think their presence will cause any issues, they will likely just be ignored. I could tell you with more certainty if you show the current contents of your /boot.

The files in /dev and /run are completely irrelevant since these directories contain special files that are created on boot or upon device connection. Anything you create in those directories will not survive a restart anyway.

The files in /sbin might be more of an issue. If you have actually overwritten the files there with ones coming from your Pi, they will almost certainly not run on your Ubuntu because the Pi is a different architecture (ARM) so they will have been compiled for the ARM and will not run on amd64 or i386 or whatever you have on your machine. The siplest solution for this would be to copy these files over from a live server CD.

share|improve this answer
    
@user269465 please edit your question to add more info, it is hard to read in the comments. That said, it looks like the important stuff is still there. –  terdon Apr 16 at 17:10
    
I have listed the contents of /boot in an easier to read format. –  Shaka Zulu Apr 17 at 18:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.