Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Ubuntu Server | MDADM | Power Management

  1. #1
    Join Date
    Dec 2007
    Location
    Italy
    Beans
    46
    Distro
    Ubuntu

    Ubuntu Server | MDADM | Power Management

    Hi,
    I run Ubuntu server 12.04.1 LTS with mdadm and two RAID-1 SAta HD.
    I wish to set this server that if there is no access to the HDs it will go into power saving so that I can save electricity.
    I use this server as a NAS but there are long hours of inactivity during the 24h. Sometimes, I do not access it even in 2 days.

    Can someone please instruct me on how to implement this? Internet references, step by step, is also welcomed if needed.

    My BIOS handles Power managment as well as my HDs being two Seagate 1.5TB HD ST31500341AS

    Thank you,
    Spiro

  2. #2
    Join Date
    Dec 2007
    Location
    Italy
    Beans
    46
    Distro
    Ubuntu

    Ubuntu Server | MDADM | Email notifications

    Hi,
    i run Ubuntu server 12.04.1 LTS on my LAN as a NAS.
    I wish to setpu MDADM in a way that if something goes wrong with the array or the physical discs I am notified by email being, I assume, the only way to let the server comunicate with me.
    My LAN has this server and two PC desktops runing Windows 7.

    Is it possible to set the MDADM system use an existing email account with existing SMTP so that the email gets properly delivered? I ask this because if I set up local mail I fear that it will be blocked as it could be considered by other Admin systems as "an open relay email server".

    How to accomplish my task?

    thank you,
    Spiro

  3. #3
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,120
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Ubuntu Server | MDADM | Power Management

    I cover this in my tutorials for mdadm. http://zackreed.me/articles/60-spin-...dle-hard-disks

  4. #4
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,120
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Ubuntu Server | MDADM | Email notifications

    I use mdadm's monitor functionality + smartmontools to monitor my disks and arrays. Then, I use sSMTP + my gmail account to send me emails. Here's how I set it up.

  5. #5
    Join Date
    Dec 2007
    Location
    Italy
    Beans
    46
    Distro
    Ubuntu

    Server bootup error after mdadm install/configuration

    Hi,

    it seems like I am unable to get mdadm to work.
    After I installed all and mount the array succesfully, when I reboot I do get problems at boot time and also am unable to mount.

    Here is what I get as error:
    fsck da util-linux 2.20.1
    fsck da util-linux 2.20.1
    /dev/mapper/ubuntu-root: clean, 176010/4331248 files, 1718890/18632776 blocks
    /dev/sdc1 non è stato smontato in maniera corretta, controllo forzato.
    Controlle degli errori nelle unità disco. Potrebbe richiedere qualche minuto.
    Premere C per annullare tutti i controlli in corso
    [ 21.500021] irq 18: nobody cared (try booting with the "irqpool" option)
    [ 21.500233] handlers:
    [ 21.500272] [<ffffffff81493b90<>] usb_hcd_irq
    [ 21.500359] Disabling IRQ #18
    /dev/sdc1: 237/124496 files (4,6% not contiguous), 67105/248832 blocks
    mountall: fsck /boot [284] terminato con stato 1

    L'unità disco per /mnt/array_0 non è ancora pronta o non è presente.
    Attendere oppure premere S per omettere il mount o M per il ripristino manuale.

    Whant on hearth is happening?

    /dev/sdc1 is the partition of the hd of ubuntu OS
    /mnt/array_0 is the mount point of the mdadm array.

    Please help.

    Thank you,
    Spiro

  6. #6
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Ubuntu Server | MDADM | Power Management

    Merged three threads on mdadm, in order to get all the answers in one place.

  7. #7
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,120
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Server bootup error after mdadm install/configuration

    Quote Originally Posted by SAngeli View Post
    Hi,

    it seems like I am unable to get mdadm to work.
    After I installed all and mount the array succesfully, when I reboot I do get problems at boot time and also am unable to mount.

    Here is what I get as error:
    fsck da util-linux 2.20.1
    fsck da util-linux 2.20.1
    /dev/mapper/ubuntu-root: clean, 176010/4331248 files, 1718890/18632776 blocks
    /dev/sdc1 non è stato smontato in maniera corretta, controllo forzato.
    Controlle degli errori nelle unità disco. Potrebbe richiedere qualche minuto.
    Premere C per annullare tutti i controlli in corso
    [ 21.500021] irq 18: nobody cared (try booting with the "irqpool" option)
    [ 21.500233] handlers:
    [ 21.500272] [<ffffffff81493b90<>] usb_hcd_irq
    [ 21.500359] Disabling IRQ #18
    /dev/sdc1: 237/124496 files (4,6% not contiguous), 67105/248832 blocks
    mountall: fsck /boot [284] terminato con stato 1

    L'unità disco per /mnt/array_0 non è ancora pronta o non è presente.
    Attendere oppure premere S per omettere il mount o M per il ripristino manuale.

    Whant on hearth is happening?

    /dev/sdc1 is the partition of the hd of ubuntu OS
    /mnt/array_0 is the mount point of the mdadm array.

    Please help.

    Thank you,
    Spiro
    What's the output of these commands?

    Code:
    cat /etc/mdadm/mdadm.conf
    Code:
    cat /proc/mdstat
    Code:
    cat /etc/fstab

  8. #8
    Join Date
    Dec 2007
    Location
    Italy
    Beans
    46
    Distro
    Ubuntu

    Re: Server bootup error after mdadm install/configuration

    Quote Originally Posted by rubylaser View Post
    What's the output of these commands?
    Hi,

    here are the answers:

    Code:
    cat /etc/mdadm/mdadm.conf
    DEVICE /dev/sda1 /dev/sdb1
    ARRAY /dev/md/0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f name=ubuntu:0
    Code:
    cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md127 : active (auto-read-only) raid1 sdb1[1] sda1[0]
          1465006336 blocks super 1.2 [2/2] [UU]
    
    unused devices: <none>
    Code:
    cat /etc/fstab
    # /etc/fstab: static file system information.
    # ============================================================================================
    #
    # <file system> <mount point>   <type>          <options>                       <dump>  <pass>
    #
    # Updated last: Jan, 26th, 2013 Time; 02:35PM
    #
    # ============================================================================================
    
    
    proc            /proc           proc    nodev,noexec,nosuid                     0       0
    /dev/mapper/ubuntu-root /       ext4    errors=remount-ro                       0       1
    
    UUID=5be45eae-b83c-4ff8-8a29-a3d322cba241 /boot           ext2    defaults      0       2
    /dev/mapper/ubuntu-swap_1 none  swap            sw                              0       0
    
    /dev/sdc        /media/cdrom    udf,iso9660     user,noauto,exec,utf8           0       0
    /dev/md0        /mnt/array_0    ext4            relatime,acl,errors=remount-ro  0       1
    Here is some additional info, if helpful:
    Code:
    root@ubuntu:~# mdadm --detail /dev/md0
    mdadm: cannot open /dev/md0: No such file or directory
    
    root@ubuntu:~# mdadm --detail --scan
    ARRAY /dev/md/ubuntu:0 metadata=1.2 name=ubuntu:0 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f
    
    root@ubuntu:~# mdadm --examine --scan
    ARRAY /dev/md/0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f name=ubuntu:0
    
    root@ubuntu:~# mdadm --brief --detail --verbose /dev/md0
    mdadm: cannot open /dev/md0: No such file or directory
    I have two questions:
    1. is it possible to assign a name to the mdadm array or is it irrelevant?
    This is what I refer to (what is in boldface):
    ARRAY /dev/md/0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f name=ubuntu:0

    2. After creating the mount point "mkdir /mnt/array_0" I have to assign proper ownership. What do I assign? User Name or root or what?
    Currently I assigned "chown sangeli /mnt/array_0" as I access the server with this credential.
    Can you please elaborate more on what options do I have here?

    Thank you,
    Spiro

  9. #9
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,120
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Server bootup error after mdadm install/configuration

    Quote Originally Posted by SAngeli View Post
    Hi,

    here are the answers:

    Code:
    cat /etc/mdadm/mdadm.conf
    DEVICE /dev/sda1 /dev/sdb1
    ARRAY /dev/md/0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f name=ubuntu:0
    Code:
    cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md127 : active (auto-read-only) raid1 sdb1[1] sda1[0]
          1465006336 blocks super 1.2 [2/2] [UU]
    
    unused devices: <none>
    Code:
    cat /etc/fstab
    # /etc/fstab: static file system information.
    # ============================================================================================
    #
    # <file system> <mount point>   <type>          <options>                       <dump>  <pass>
    #
    # Updated last: Jan, 26th, 2013 Time; 02:35PM
    #
    # ============================================================================================
    
    
    proc            /proc           proc    nodev,noexec,nosuid                     0       0
    /dev/mapper/ubuntu-root /       ext4    errors=remount-ro                       0       1
    
    UUID=5be45eae-b83c-4ff8-8a29-a3d322cba241 /boot           ext2    defaults      0       2
    /dev/mapper/ubuntu-swap_1 none  swap            sw                              0       0
    
    /dev/sdc        /media/cdrom    udf,iso9660     user,noauto,exec,utf8           0       0
    /dev/md0        /mnt/array_0    ext4            relatime,acl,errors=remount-ro  0       1
    Here is some additional info, if helpful:
    Code:
    root@ubuntu:~# mdadm --detail /dev/md0
    mdadm: cannot open /dev/md0: No such file or directory
    
    root@ubuntu:~# mdadm --detail --scan
    ARRAY /dev/md/ubuntu:0 metadata=1.2 name=ubuntu:0 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f
    
    root@ubuntu:~# mdadm --examine --scan
    ARRAY /dev/md/0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f name=ubuntu:0
    
    root@ubuntu:~# mdadm --brief --detail --verbose /dev/md0
    mdadm: cannot open /dev/md0: No such file or directory
    I have two questions:
    1. is it possible to assign a name to the mdadm array or is it irrelevant?
    This is what I refer to (what is in boldface):
    ARRAY /dev/md/0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f name=ubuntu:0

    2. After creating the mount point "mkdir /mnt/array_0" I have to assign proper ownership. What do I assign? User Name or root or what?
    Currently I assigned "chown sangeli /mnt/array_0" as I access the server with this credential.
    Can you please elaborate more on what options do I have here?

    Thank you,
    Spiro
    The reason your array is not mounting is that it's presenting itself as /dev/md/0 instead of /dev/md0. The name line is unnecessary for proper assembly, so you can leave that out. I would do the following.

    Code:
    sudo -i
    Remove everything from /etc/mdadm/mdadm.conf and paste this.
    Code:
    DEVICE partitions
    HOMEHOST fileserver
    MAILADDR youruser@gmail.com
    ARRAY /dev/md0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f
    You do not need to explicitly name your devices or name the array. Right now, your mdadm.conf is contradicting your actual array and is causing problems. Your devices are /dev/sd[ab]1 not /dev/sd[ab]. Just use partitions, and mdadm will figure it out. mdadm is smart, it will automatically assemble the array correctly.

    You can leave your /etc/fstab as is. In regards to permissions, you can set them to whatever level of security you'd like. If this is just a home fileserver and you want it wide open, just.

    Code:
    chmod -R 777 /mnt/array_0
    Finally, you need to update your initramfs
    Code:
    update-initramfs -u
    Finally, reboot, and it should come up correctly.
    Code:
    reboot

  10. #10
    Join Date
    Dec 2007
    Location
    Italy
    Beans
    46
    Distro
    Ubuntu

    Re: Ubuntu Server | MDADM | Power Management

    Excellent job. I do thank you for your help!

    I have few follow-up questions so I can learn and understand.
    There is a difference between knowing things and following guides. Unfortunately, I am a guide follower

    1.
    DEVICE partitions
    HOMEHOST fileserver
    MAILADDR youruser@gmail.com
    ARRAY /dev/md0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f
    HOMEHOST can I put my hostname being "ubuntu" ?

    array_0 ownership.
    When I created the dirctory, during setup, I typed:
    Code:
    chown sangeli /mnt/array_0
    but now that the mount is available if I ls -la I see:
    Code:
    drwxr-xr-x  3 root root 4096 gen 26 19:29 array_0
    should it be sangeli?
    Can you please explain what should I do?

    2. Watching a guide on YouTube I was told to do the followings:
    1. run "sudo mdadm --examine --scan"
    2. than copy the output into clipboard
    3. edit "/etc/mdadm/mdadm.conf"
    4. type "DEVICE /dev/sda1 /dev/sdb1"
    5. paste the mdadm output, being in my case:
    ARRAY /dev/md/0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f name=ubuntu:0

    But this is wrong as you corrected me two parts:
    From "ARRAY /dev/md/0" to "ARRAY /dev/md0"
    and you removed "name=ubuntu:0"

    Can you please elaborate for future install so I make corrections on my guide.

    3. You also mentioned that I need to update your initramfs.
    i have no clue on this. Can you please explain what is it for and when should I run it during the entire process of mdadm installation/configuration?

    4. Lastly, is there a complete manual for beter learning mdadm?

    thank you,
    Spiro

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •