EzDevInfo.com

ubuntu-server interview questions

Top ubuntu-server frequently asked interview questions

Ubuntu Server 14.04 - RAID5 created with mdadm disappears after reboot

This is my first question on superuser, so if I forgot to mention something, please ask.

I'm trying to set up a home server which will be used as file server and media server. I installed Ubuntu Server 14.04 and now I'm trying to set up a Raid5 consisting of a total of 5 disks, using mdadm. After the raid has been created, I am able to use it and I can also access the Raid from other PCs. After rebooting the server, the Raid does not show up anymore. I have also not been able to assemble the raid.

I have done the following steps:

Create the RAID

mdadm --create --verbose /dev/md0 --level=5 --raid-devices=5 /dev/sda /dev/sdc /dev/sdd /dev/sde /dev/sdf

After the RAID has been completed (watch cat /proc/mdstat), I store the RAID configurations

mdadm --detail --scan >> /etc/mdadm/mdadm.conf

Then I removed some parts of the entry in mdadm.conf. The resulting file looks as follows:

# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#

# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers
#DEVICE partitions

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root

# definitions of existing MD arrays

# This file was auto-generated on Fri, 14 Mar 2014 23:38:10 +0100
# by mkconf $Id$
ARRAY /dev/md0 UUID=b73a8b66:0681239e:2c1dd406:4907f892

A check if the RAID is working (mdadm --detail /dev/md0) returns the following:

/dev/md0:
Version : 1.2
Creation Time : Sat Apr 19 15:49:03 2014
Raid Level : raid5
Array Size : 7813531648 (7451.56 GiB 8001.06 GB)
Used Dev Size : 1953382912 (1862.89 GiB 2000.26 GB)
Raid Devices : 5
Total Devices : 5
Persistence : Superblock is persistent

Update Time : Sat Apr 19 22:13:37 2014
State : clean
Active Devices : 5
Working Devices : 5
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 512K

Name : roembelHomeserver:0  (local to host roembelHomeserver)
UUID : c29ca6ea:951be1e7:ee0911e9:32b215c8
Events : 67

Number   Major   Minor   RaidDevice State
0       8        0        0      active sync   /dev/sda
1       8       32        1      active sync   /dev/sdc
2       8       48        2      active sync   /dev/sdd
3       8       64        3      active sync   /dev/sde
5       8       80        4      active sync   /dev/sdf

As far as I can tell, this all looks good. In a next step I created the file system:

mke2fs -t ext4 /dev/md0

This results in the following output:

mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=512 blocks
244174848 inodes, 1953382912 blocks
97669145 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
59613 block groups
32768 blocks per group, 32768 fragments per group
4096 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
    102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

Then I changed to fstab by adding the following entry at the end of the file:

/dev/md0    /data    ext4    defaults,nobootwait,no fail     0    2

After mounting the RAID (mount -a) I then could use it, create files, access it from other PCs...

Now comes the problem:
After rebooting the server (reboot now), the RAID does not exist anymore, i.e.
- No /dev/md0
- empty /proc/mdstat (besides the Personalities)
- df -h does not show the raid
- mdadm --assemble --scan does not do anything

Does anyone have any suggestions? Did I do something wrong?


Source: (StackOverflow)

How to ACTUALLY install Java on Linux?

I have a Ubuntu Server.

From the terminal, how should I install JDK?

In this guide it says to use this command:

sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk

But on Suns website, it says JDK includes the JRE, so why the JRE in the line above?

Anybody know how to actually install Java?

Every guide and every forum shows different ways of doing it.

BTW: It is a VPS (virtual private server)

Thanks


Source: (StackOverflow)

Advertisements

Is there a speed difference between transferring files over FTP and Samba?

I have a home network setup with a desktop PC, two laptops and a ubuntu server desktop all connected to a router (DD-WRT). I want to setup the ubuntu server on a separate subdomain (security reasons: I have websites coming into the server) but I also want to have access to the backup drives that I've installed on the server. I know that I can setup a FTP server on Ubuntu, but I'm wondering if I'm going to lose the speed while transferring that way. Anybody know a solution I can use?


Source: (StackOverflow)

How can I boot an Ubuntu server without monitor/keybord?

I am new in servers. I have an old PC. I want to install Ubuntu Server on that PC and keep it on my home network. The problem is that I can't keep the monitor and the keyboard. So the questions are:

  • How can I have the server without monitor/keyboard and access it with my laptop through my home network?

  • How can I boot the machine without monitor/keyboard anytime I want? (I think that without monitor/keyboard the BIOS would throw errors.)

Can anyone explain the process to me? I have searched the internet but got confused.


Source: (StackOverflow)

Is it possible to install Ubuntu Server 10.04 *from* a USB drive?

I've tried the Universal USB Installer from PenDrive, and put 10.04 Ubuntu Server on it. But when I boot up and try to install, it looks for a Ubuntu CD ROM, which I do not have.

I thought the whole point is to be able to install from a USB, which seems easy with the Desktop version. Why is the server version not allowing me to do this? Am I missing something?


Source: (StackOverflow)

How do I upgrade from Ubuntu Server 12.10 to Ubuntu Desktop?

Hi I would like to upgrade from Ubuntu Server 12.10 which I have no idea how to use, to Ubuntu Desktop so that I can install my Windows Server 2008. Please help. Thank


Source: (StackOverflow)

Running Cronjobs as per Local Time rather than Universal Time

On running

dpkg-reconfigure tzdata

in terminal and i get 2 different time on my machine

Local time is now:      Wed May  1 11:58:55 IST 2013.
Universal Time is now:  Wed May  1 06:28:55 UTC 2013.

The Problem is i want to run my cronjobs as per Local Time which is in IST, but they are running as per Universal Time UTC. Where do i need to make the necessary changes to acheive the desired behaviour ?


Source: (StackOverflow)

Got Ubuntu Server, Now What?

As a learning experience I recently downloaded and set up Ubuntu 10.04 Server edition. When I logged in for the first time, all I saw was a terminal. I stared blankly at the screen, wondering what in the world do I do from here.

That's my question. How do I configure a server and maintain it from the terminal? Tutorials, books, guides, things like that would be the most useful. Thanks!


Source: (StackOverflow)

Disable Frequency Scaling “ondemand” daemon on Ubuntu 10.04

I noticed today that a process "ondemand" was running on my Ubuntu Server that I recently upgraded (following the recommended process) from 9.10 to 10.04. Why on earth would they install this by default on a server, and how do I turn it off?


Source: (StackOverflow)

How to properly install WD Advanced Format drive in Ubuntu as 2nd HDD?

I got a new Western Digital WD15EARS Caviar Green 1.5TB SATA drive but it seems to use WD new advanced format using 4k blocks or something (I get the general idea but not really).

Is there a way to properly format it for an Ubuntu 9.10 Server to take advantage of the advanced format? Such as with sector sizes?


Source: (StackOverflow)

How to fix warning about ECDSA host key

I'm trying to setup password-less SSH on an Ubuntu server with ssh-copy-id myuser@myserver, but I'm getting the error:

Warning: the ECDSA host key for 'myserver' differs from the key for the IP address '192.168.1.123'

What's causing this, and how do I fix it? I tried deleting the .ssh directory on the remote machine, and running ssh-keygen -R "myserver" locally, but this doesn't resolve the error.


Source: (StackOverflow)

Is there any easy way to copy from a VirtualBox Guest to the Host?

I have Windows 7 and use VirtualBox. I have installed Ubuntu Server as a guest.

Is there any easy way where I can copy text in the Ubuntu Server terminal to my Windows 7 host? How about in the other direction?


Source: (StackOverflow)

How do I copy data from a Ubuntu server using terminal by telnet?

I have one folder to copy that consists of PHP and similar files for creating a web site.

How do I copy one folder from the server (Linux Ubuntu) to the client PC (Linux Ubuntu) using terminal? Could I use ftp? For the terminal connection I'm using Telnet.

The folder location on the server:

qa@ubuntu:~/www/html/js 

And I want to copy it to the client at:

qa@desktop2:~/home/qa/html

Source: (StackOverflow)

Port Forwarding to a VMware Workstation Virtual Machine

I am running VMware Workstation 8 (build 471480). I want to setup a small content server, mainly for images and such for my website, on my desktop in a virtual server (just for the heck of it)... I now have everything installed on a VMWare virtual machine running Ubuntu Server and already have the web server running. I have tested it and it works fine within the network when accessing it from the host.

I now need to make it work on the public Internet and am planning on using noip.com, as i have done on many other occasions.

The problem is that my router is a Linksys E2500 and it only allows port forwarding to IPs within its subnet (192.168.2.**)

The host system connected to the router has an IP of 192.168.2.177. The VMware Workstation 8 virtual machine has a Network type of NAT and the IP for the server on it is 192.168.43.130.

I have already forwarded port 80 and 22 to 192.168.2.177, but how can i get my Windows 7 system to then forward that port to the server ip?


Source: (StackOverflow)

Are automatic security updates recommended for Ubuntu Server

I'm setting up a new server. It will be mostly hands of for sysadmin management, because it's not used for anything too high traffic/ enterprise. If I choose automatic security updates will the updates cause the server to restart on its own (in order to complete the installation process), or will I have to login restart (or set up a chron job)?


Source: (StackOverflow)