Beiträge von ptruman

    Hi all
    I've done something very stupid and have to rebuild my NAS. Whilst at it I will install Erasmus, having been on OMV2.


    If I remove my data partition disks (Raid 1) and then reinstall, and reconnect my Raid 1 - will it auto detect? Or what will I need to do?


    Thanks in advance.

    Lo there


    Still lurking, just not much time
    Just noticed my GUI update window is blank, but I'm getting apt emails, and apt-get upgrade works.
    Clicking "check" goes through the motions, but shows nothing.


    What's broken? :)

    Just to chip in (not much surf time!) - I do use WOL infrequently, but definitely DO use dnsmasq and OpenVPNAS a *lot* - I'd be reluctant to move to 3.0 without those!


    I'm using:
    - RemoteShare (for box.com - but could live without it)
    - Fail2Ban (but could live without it)
    - WOL (used occasionally, but could live without it)
    - OMV Backup (not actually used properly yet)
    - MiniDLNA (used frequently for media access)
    - DNSMasq (essential - the whole house is DHCP and works off the NAS)
    - OpenVPNAS (essential - I VPN in frequently)
    - SSH (essential, used when VPN fails)
    - AntiVirus (ClamAV) (left alone, but quite essential)
    - NUT (essential - has saved the NAS during powercuts and executed safe powerdown)
    - ExtPlorer (actually really handy when I SSH in and want to browse files, port fwd a browser to the GUI and away!)
    - OMVExtras


    If I had the spare time I'd look to assist more, but spare time is very infrequent these days!

    Tried, but got :



    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    proftpd-mod-vroot is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


    If I remove the line from the proftpd.conf, and apply, then OMV puts it back in via one of the many .inc files :\

    Checking the changelog for 1.0.22 it says something about clean up of proftpd script?


    I tried to enable the FTP plugin and got this (which I've had since upgrading to Kralizec)


    Failed to execute command 'export LANG=C; invoke-rc.d 'proftpd' start 2>&1': Starting ftp server: proftpdMEDIAVAULT proftpd[8063]: mod_dso/0.5: module 'mod_vroot.c' already loaded MEDIAVAULT proftpd[8063]: Fatal: LoadModule: error loading module 'mod_vroot.c': Operation not permitted on line 2 of '/etc/proftpd/proftpd.conf' failed! invoke-rc.d: initscript proftpd, action "start" failed.


    Also on a more random note, when I upgraded, my sudo path broke - as "service" and other commands stopped working. One to watch for some maybe? :)

    OpenVPNAS requires another port 0 - the "beauty" of OpenVPN is "one port" - so I can tunnel that over HTTPS if needs be. OpenVPNAS wants two ports?
    OpenVPN is working fine, although I have to manually add the config options that were in the GUI - and bring back a script from 0.4 to do the user/pass secondary authentication.


    Minidlna is dying just looking at JPG and MP3 files. It gets 300 files in and dies.
    I've downloaded the 'wheezy' distribution copy and that works fine. Something in 1.1.4 is less than ideal :\


    I couldn't get DNSMasq out of the beta repo for some reason (also : new baby = no brain), but manually hauled it out of github and built it ok. Can't see any issues with it though - it picked up my config files and 'works'.


    And IE8 = a system I have no control over which I use periodically :)

    Hi all


    Been away, as our family has recently expanded.


    Yesterday I went from 0.4 to 0.5 - which went fairly smoothly (removed plugins, upgraded, put plugins back)
    Then I did 0.5 to 1.0 - and that "didn't go so well".


    I removed the plugins (except NUT) and did the upgrade - which said it would remove NUT itself.
    When it finished, I had the white screen/NGINX screen - so did some reading about removing apache2 (via rc.d) and got the GUI working.
    Then I found samba was dead, and I had to manually re-enable each share. That caused a bit of worry!
    SSH was also not working and needed a service restart - and when I had no GUI initially that made life interesting (headless box!)


    Comments so far :


    1) Generally the majority of things seem ok
    2) OpenVPN plugin 'works' but misses a lot of the original - inability to generate the CA from scratch (with custom keys), inability to set password AND cert requirements in the GUI (but can be done via the additional commands box).
    3) MiniDLNA seems to be broken - mine scans 300 files and 'stops'. I've built minidlna from source and that does it too - might try an older version.
    4) DHCP/DNSMasq really *really* is missed - I went to GITHUB and built it from source and installed it - and it picked up my old 0.4 configs and is running perfectly
    5) NTP seems broken? I noticed my NAS was saying 10am when it was 5pm - and it refused to update. I had to download ntpdate to force a date change. Now it seems a bit happier.
    Also - it would be good to have an option to have OMV act as a time server - I've enabled it in config but each reboot removes that line :)
    6) FTP is broken (mod_root) but I saw that in the buglist :)
    7) I think the upgrade to 1.0 also upgraded OpenSSL, which in turn broke my RADIUS server - and the LATEST (manually built) FreeRADIUS reports the OpenSSL version which comes with the new distro is vulnerable to Heartbleed. That may be worth noting to people who open their boxes to the wider internet.


    :)


    In other random news, this new forum does NOT present well on IE8 (forced to use it in some places) so apologies if this is in the wrong place - took me ages to find a "post" button - and I could only see "reply"

    Zitat von "tekkbebe"

    For me it is openvpn and cups plugins. I can setup openvpn and cups manually but why. Also, it's not like I'm not using .5. I probably use it as much as anyone. Yesterday I was testing a RAID 0 with LVM on top in a vm with 2 vds. So I get my fill. :lol: :lol:


    Pretty much this. I'm now using CUPS as the local (back) end for Google Cloud printing, and actually have used it (scary!). And OpenVPN.
    Although OpenRemote is stealing my time at the mo...... :)

    You can only pick *3* plugins?! The horror!


    My setup has :


    Antivirus (runs nightly)
    CUPS (infrequent at present - but I suspect will pick up)
    DNSMasq (used every few hours, every device in the house is set off DHCP via my OMV box!)
    MiniDLNA (used a few times a week)
    NUT (used by my main PC whenever it's on, it auto shuts down if my UPS notices a power outage)
    OpenVPN (used quite a lot)
    SSH (used a few times a week/quite a lot in conjunction with VPN)
    VirtualBox (infrequent use - installed for testing PABX/PIAF - but found the N40L a bit lacking for virtual telephony)


    Not to mention I'm running Asterisk (+ Asterisk GUI & FOP2 Server), OpenRemote, FreeRADIUS and DNSCrypt running on the box too.....

    Zitat von "tekkbebe"

    Nice to see you posting again Pete.


    :)


    I lurk. To be fair, OMV tends to sit and "do it's job" until I think of something silly/geeky to do. I've just upgraded my LTO1 drive to an LTO3, and am presently backing up my shares to tape.

    TUTORIAL : Installing OMV & converting O/S to RAID1


    Postby mr-pete (now ptruman) » Fri Mar 30, 2012 4:00 pm


    After much fiddling, I now have the OMV O/S partitions on a software RAID1. I did originally do this with dmraid and my servers BIOS "fakeraid", but it was a bit problematic, so I moved it to s/w RAID with mdadm. My data is then on 2 other drives, also in RAID1.


    I did this *ideally* I wanted the O/S to be resilient, as :


    a) I don't have a "proper" H/W RAID controller
    b) My machine only support FakeRAID (BIOS RAID) and OMV doesn't get on it with it
    c) My OMV server runs more than just OMV, so ideally it needs to be recoverable ASAP


    The method I've gone with should (I hope) let my system boot if either of the RAID1 O/S pair fails (and is removed), or, failing that, can be recovered via a rescue boot from the ISO, and a swift dose of mdadm and grub-mkconfig


    And this is how I did it...


    Prerequisitites
    A server :)
    At least 4 drives - 2 for the O/S and 2 for data (each pair should be of identical size!)
    At least 2 hours spare to get the O/S done (based on my O/S drives being SATA 1.5Gbps 80GB drives)
    A CD-ROM drive (I used a PATA IDE CDROM connected via a USB adaptor)
    A CD-ROM/USB stick with the OMV boot ISO on it


    Disclaimer 1 : The majority of these instructions came from this page (http://www.pinguin-systeme.net…system-to-a-raid-1-system) on converting a running system to RAID1 - but I had to tailor it somewhat. Hopefully this also saves you searching :)
    Disclaimer 2 : If you break your system/data/life - it's not my fault - these instructions worked for me. They may not for you/your system!
    Disclaimer 3 : I am by no means a Unix/Linux expert/practitioner, but I got this going. Again, if you're not a guru, I hope this helps.


    Step 1)
    Starting with a powered DOWN server,
    Remove ALL HDDs from the computer
    Insert ONE HDD that you want as part of the intended RAID1 O/S drive into the server, on the first SATA port
    NB: If you're going to use a USB boot device for the ISO, connect it now...


    Step 2)
    Power up the server - insert the boot CD if you're going to use it
    Ensure the server boots from CD (amend your BIOS/boot order if necessary)
    Allow the server to run a default/basic (hands free) installation (unless you need to play with expert mode)
    Remove the CD/USB stick when prompted, and let the server reboot


    Assuming all went well with the default install, OMV should boot up, on a single disk - now you can start upgrading :)


    Step 3)
    Login to the server as root, or sudo bash to a root prompt
    Now is the time to save yourself time later, especially if you're working with one monitor and/or no KVM!


    Open the OMV Web GUI and go to the SSH section. Enable it, and click Ok.
    If you setup a root login during the install process, tick "Permit root login" and click Ok.
    If you did NOT setup a root login (i.e. you opted to use sudo), then go back to a command prompt on the server and run


    Code
    usermod -a -G ssh <youruser>



    Your user can now login via ssh and you can avoid using the console, unless you really screw things up later :)


    Step 4)
    Re-insert the OMV ISO CD/USB stick


    Code
    shutdown -h now


    To shutdown the server


    Now insert the 2nd disk you want as part of the intended RAID1 O/S drive into the server, on the second SATA port and boot up and get to a root prompt.


    Then, you need to exactly clone the partition table from /dev/sda to /dev/sdb, by running


    Code
    sfdisk -d /dev/sda | sfdisk --force /dev/sdb


    The --force switch is key, otherwise you will find your partitions likely don't exactly match, and you'll get stuck later. I did, and it cost me an hour... :(


    You should then run


    Code
    fdisk -l /dev/sda
    fdisk -l /dev/sdb


    You should output from both two drives, and (this is key) all the start, end and block columns should match. If they don't, you didn't use --force above, or something has gone wrong - go no further until you've sorted that out.


    NB: In the fdisk -l output, you should see three partitions (/dev/sda1, /dev/sda2 and/dev/sda5), listed as Ext4, Extended and Swap. Again, if you don't have those three listed, and they are not of those types, something went wrong in the installation partitioning - go no further until you've sorted that out.


    Step 5)
    Assuming the partitions cloned successfully, you can setup the initial RAID on the 2nd drive, by typing :


    Code
    mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/sdb1
    mdadm --create /dev/md1 --level=1 --raid-disks=2 missing /dev/sdb5


    The above creates a software RAID1 array on the second drive (you'll see why in a minute), using partitions 1 (ext4) and 5 (swap).


    Now we need to format both new partitions, which is achieved by typing:


    Code
    mkfs.ext4 -j /dev/md0
    mkswap /dev/md1


    Now we have to copy all the data from the first drive to the second, to get things ready, so type


    Code
    mkdir /mnt/md0
    mount /dev/md0 /mnt/md0
    cp -axu / /mnt/md0


    The above will mount the RAID array on the second drive and copy everything across.


    Now things get funky :)


    Step 6)
    Now, backup your /etc/fstab & GRUB2 configuration files (as at present your system can still boot if necessary, via /dev/sda1)


    Code
    cp /etc/fstab /etc/fstab.orig
    cp /boot/grub/grub.cfg /boot/grub/grub.cfg.orig


    Now, you need to get the unique ID names for your drive partitions, by running :


    Code
    blkid



    Copy the output from that and save it somewhere handy so you can use it cut & paste.
    You are looking for the line that starts /dev/md0 - and you need the full UUID string between the quote " marks (not including the " marks)


    Edit the /etc/fstab file by typing :


    Code
    nano /etc/fstab


    Look under the following line...
    # <file system> <mount point> <type> <options> <dump> <pass>


    ...to find the root filesystem lineThis will look something like
    /dev/sda1 / ext4 errors=remount,ro 0 1


    OR
    UUID=<UUID string> / ext4 errors=remount,ro 0 1



    Replace EITHER /dev/sda1 OR the existing <UUID string> with the one you copied from the blkid output earlier.
    Press CTRL-X to quit nano, and press Y when it asks if you want to save the file, then press RETURN to confirm the save.


    You have now amended the mount configuration to mount the root filesystem from the newly defined (and still incomplete) RAID array.
    Now we need to get GRUB2 to boot off the second SATA disk.


    Edit the /boot/grub/grub.cfg file by typing :


    Code
    nano /boot/grub/grub.cfg



    Scroll down in the file until you find the line
    ### BEGIN /etc/grub.d/10_linux ###



    Find the FIRST set of two lines that start
    search --no-floppy --fs-uuid --set
    linux /boot/vmlinuz-2.6.32-5-amd64 root=UUID=


    And replace the UUID at the end with the UUID of /dev/md0 you copied from the blkid output earlier.
    Press CTRL-X to quit nano, and press Y when it asks if you want to save the file, then press RETURN to confirm the save.


    Now reboot your system and check all is well!


    Code
    shutdown -r now



    Step 7)
    At this point you should have a booting system (now loading the root filesystem from the second disk), although your RAID is still not setup.
    However, as your root filesystem is now on the second disk, you are free to add the first disk into the array (as it's not locked by the O/S)


    First of all, the main partitions on both drives must be changed from ext4 & swap to "Linux raid autodetect"
    To do this, login, and get a root prompt.
    Then update the first disk by typing :


    Code
    fdisk /dev/sda


    Then enter the following keystrokes :


    Code
    t
    1
    fd
    t
    5
    fd
    w


    Don't worry if you see any errors about needing to reboot first.
    Then update the second disk by typing :


    Code
    fdisk /dev/sdb


    Then enter the following keystrokes :


    Code
    t
    1
    fd
    t
    5
    fd
    w


    Again, don't worry if you see any errors about needing to reboot first.
    NB: We only need to update the partitions numbered 1 & 5 - don't worry about partition 2.


    Now force the partitions to commit and be re-read by typing :


    Code
    partprobe



    Verify the new partition types have set by running :


    Code
    fdisk /dev/sda
    fdisk /dev/sdb


    Check the types now read (in order, on both disks)
    Linux raid autodetect
    Extended
    Linux raid autodetect



    Step 8)
    Now it's (finally) time to add the first disk into the array. Remember you're now loading the root filesystem from the second disk, so it's not locked - so enter :


    Code
    swapoff -a
    mdadm /dev/md126 -a /dev/sda1
    mdadm /dev/md127 -a /dev/sda5


    The above disable swap usage so you can add partition 5, and then adds partitions 1 & 5 to the array.
    We're now referencing /dev/md126 & /dev/127 as the system rebooted and changed the references from 0 & 1. If the above doesn't work for you, run blkid again, and find the two bottom entries, which should read ext4 & swap. The ext4 partition is the lower number (i.e. /dev/md0 OR /dev/md126) and the swap partition is the other.


    Hopefully now the RAID is assembling. You can speed this up and watch it by typing :


    Code
    echo 50000 >/proc/sys/dev/raid/speed_limit_min
    watch cat /proc/mdstat


    NB: It took me 30 mins to get to this stage, and took my system a further 30 mins to fully complete the RAID assembly.


    Step 9)
    Once it's finished, we can add some future redundancy by ensuring the system can fully boot from the second disk if the first fails - by typing


    Code
    grub-install /dev/sdb



    Now - put the OMV ISO CD in the drive, and reboot


    Code
    shutdown -r now



    When the boot menu appears, choose Rescue mode - select your language and let it do it's thing.
    When you get to choose a partition, you need to select Assemble Raid and press RETURN
    You should then see /dev/md0 as an option - select that and run a shell in it.


    Now, we ensure GRUB2 is on the first disk AND the RAID by typing


    Code
    grub-install /dev/sda
    grub-install /dev/md0


    Then we update the GRUB2 config to boot out of the new RAID partition entirely - but first back it up!


    Code
    cp /boot/grub/grub.cfg /boot/grub/grub.cfg.stage2
    grub-mkconfig >> /boot/grub/grub.cfg


    Then, type exit and reboot the system.


    If all has gone well, your OMV will now be booting from a RAID1 partition. You can then shutdown, add your other drives and format/RAID those as necessary from the GUI.


    IMPORTANT NOTE :
    Your system still boots from the first SATA disk - where the grub config is read and told to load out of the /dev/md0 partition
    If you later come to do an apt-get dist-upgrade you MAY find (if you don't read all the prompts you get) that your system fails to boot when you reboot - as the mdadm.conf may have been amended by OMV, and you're stuck at a nice (initramfs) prompt.


    If that's the case, don't worry - you can temporarily boot your system by typing


    Code
    mdadm --assemble -scan
    CTRL-D


    Your system will assemble your RAID and boot, but you have to do this every time.


    If this happens, let me know and I'll post my solution :)
    (which was a minor edit of /etc/mdadm.conf and adding two symbolic links in /dev)
    mr-pete