Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Ubuntu Server | MDADM | Power Management

  1. #11
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,118
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Ubuntu Server | MDADM | Power Management

    Quote Originally Posted by SAngeli View Post
    HOMEHOST can I put my hostname being "ubuntu" ?
    Yes, it can be whatever you'd like. That's the name that will show up in logs and in emails from mdadm in the event of an issue. Personally, I like to use a slightly more descriptive name. Also, when you chown'd the mount point, you didn't change the owner of the mdadm array. You'd need to run this at this point.

    Code:
    chown -R sangeli /mnt/array_0/
    Quote Originally Posted by SAngeli View Post
    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.
    Those directions aren't bad, but newer versions of mdadm will include the name stanze and will write out the device line as you've seen. It's easier to simplify the mdadm.conf as I've shown. Also, the DEVICE line with partitions is more flexible then statically naming the disks. If you add more hard drives to your computer in the future, this tutorial method presents the possibility to fail.

    Quote Originally Posted by SAngeli View Post
    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?
    This does a good job of explaining the initramfs.

    The mdadm mailing list has lots of good info, and you can always read the manpage.
    Code:
    man mdadm

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

    Re: Ubuntu Server | MDADM | Power Management

    Hi,
    so far I reached excellent results and am quite pleased. Finally I escaped FreeNas project and can rely on Ubuntu server and use the serer for different tasks rather than just for NAS services.

    I wish to ask few follow-up questions regarding power management and disk management.
    Yes, I followed the link provided me with and I have to say it is very well written.

    1. how to manually check on hdparm and smart for when I wish to see/know how my server is doing? Let's say I wish to know if the HD is already in sleep mode or not and similar info.

    2. smartd_opts="-q never -i 7200" takes care every two hours to check the HD but if they are idle it will not check. How to understand how to customize the time (7200). 7200 is for two hours. How to calculate for different hours?
    Also, if smart has to check every two hours but the hd is idle for 10 hours (as an example), than it becomes operting for 10 minutes and after 1 hour it becomes ide again and does not spin anymore when would smart perform the check? Can someone please give me a hint?

    3. I did not understan the last 4 commands of this guide:
    can someone please elaborate them? In particular the parameters I do not understand like (nano +22)

    4. I will post my HD specs. I wish to know if you find this values valid or if is there room for enhancement as I wish to obtain maximum performance in transfer rate between the NAS server and my PC when I perform backups or move files around.
    This is a Seagate 1.5TB SATA-II HD connected to a SATA-I controller (onboard IBM entry level server):

    Code:
    $ hdparm -i /dev/sda
    ======================================================================
    /dev/sda:
    
     Model=ST31500341AS, FwRev=CC1H, SerialNo=9VS4AW5C
     Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
     RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
     BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16
     CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=2930277168
     IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
     PIO modes:  pio0 pio1 pio2 pio3 pio4
     DMA modes:  mdma0 mdma1 mdma2
     UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
     AdvancedPM=no WriteCache=enabled
     Drive conforms to: unknown:  ATA/ATAPI-4,5,6,7
    
     * signifies the current active mode
    
    $ hdparm /dev/sda
    ======================================================================
    /dev/sda:
     multcount     = 16 (on)
     IO_support    =  1 (32-bit)
     readonly      =  0 (off)
     readahead     = 256 (on)
     geometry      = 182401/255/63, sectors = 2930277168, start = 0
    
    $ hdparm -Tt /dev/sda
    ======================================================================
    /dev/sda:
     Timing cached reads:   2304 MB in  2.00 seconds = 1151.90 MB/sec
     Timing buffered disk reads: 372 MB in  3.01 seconds = 123.53 MB/sec
    Thank you,
    Spiro
    Last edited by SAngeli; January 29th, 2013 at 09:10 PM.

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

    Re: Ubuntu Server | MDADM | Power Management

    1. You can check using smartctl like this.
    Code:
    smartctl --nocheck standby -i /dev/sdb
    Output should look like this...
    Code:
    smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-36-generic] (local build)
    Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net
    
    Device is in STANDBY mode, exit(2)
    2. The 7200 is in seconds. There are 3600 seconds in one hour, so 3600x2=7200, or 2 hours.
    3. nano +22 starts editing file on line 22 (this was the location of the DEVICESCAN line in 10.04). Just comment out the existing DEVICESCAN line and replace with one as I've shown.
    4. You should search for Samba tuning on this forum.
    Last edited by rubylaser; January 29th, 2013 at 11:17 PM.

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

    Re: Ubuntu Server | MDADM | Power Management

    Hi,

    the "smartctl --nocheck standby -i /dev/sda" command does not tell me if the drive is idle or active. Here is what it reports (I post the relevant info):
    Code:
    Power mode is:    ACTIVE or IDLE
    How to know exactely which one is it?

    I do not understand this section of the final instruction:
    Code:
    nano +22 /etc/smartd.conf
    
    Comment this line out
    bash
    
    DEVICESCAN -m root -M exec /usr/share/smartmontools/smartd-runner
    
    And add this below the commented out line.
    bash
    
    DEVICESCAN -S on -o on -a -I 194 -m username@gmail.com -s (S/../.././02|L/../../6/03) -n standby,q
    Yes, I don't want to spin up idle hard drives but I do not understand all the above commands. Moreover, what does the email address have to do with this?

    Can someone break down the listing and explain what is strictly needed for no spin up idle hd. Then, the rest.

    After this implementation, I received this mail:
    Code:
    /etc/cron.daily/mdadm:
    mdadm: excess host name on HOMEHOST line: NAS - ignored
    mdadm: excess host name on HOMEHOST line: Server - ignored
    How to interpret and what do to?


    Lastly, I did not get a reply for what I asked in my previous post:
    Also, if smart has to check every two hours but the hd is idle for 10 hours (as an example), than it becomes operting for 10 minutes and after 1 hour it becomes ide again and does not spin anymore when would smart perform the check?
    Basically, if the HD spins down after 1 hour of inactivity and SMART is scheduled to run every 2 hours but not inspect idel hd when will it ever chech on hd? Perhaps when the HD is not idle for logher than 2 hours?

    Thank you,
    Spiro
    Last edited by SAngeli; January 30th, 2013 at 02:02 PM.

  5. #15
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,118
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Ubuntu Server | MDADM | Power Management

    Your hard drive is still spun up if it says ACTIVE or IDLE. It would show as in STANDBY like my example if it was spun down.

    There is an existing DEVICESCAN line in your smartd.conf file. I'm asking you to comment that line out, by putting a pound (#) sign in front of the line and replacing with the line I have shown. This revised line schedules Short and Long tests periodically on your disks, and includes the options to prevent smartd from preventing your drives from spinning down. It contains an email address, because it will email you if smart values change on your disk (early warning or failure notice).

    The mdadm email is telling you the problem right in the message. You have redundant HOMEHOST lines in your mdadm.conf file. You need to only have only HOMEHOST entry in that file.

    Also, if smart has to check every two hours but the hd is idle for 10 hours (as an example), than it becomes operting for 10 minutes and after 1 hour it becomes ide again and does not spin anymore when would smart perform the check?
    With the setup I have offered smart will not check the disk if it's in standby mode, irregardless of time spun up/down. If the disk is spun up, and it's scheduled to check it, it will.

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

    Re: Ubuntu Server | MDADM | Power Management

    Hi,

    There is an existing DEVICESCAN line in your smartd.conf file. I'm asking you to comment that line out, by putting a pound (#) sign in front o
    What you require was already done. Here is my existing config file:
    Code:
    # Smart Mon. Tools "smartd.conf" configuration file
    # Home page is: http://smartmontools.sourceforge.net
    
    # DEVICESCAN -d removable -n standby -m root -M exec /usr/share/smartmontools/smartd-runner
    #
    # Added by Spiro Angeli
    DEVICESCAN -S on -o on -a -I 194 -m username@gmail.com -s (S/../.././02|L/../../6/03) -n standby,q

    The mdadm email is telling you the problem right in the message. You have redundant HOMEHOST lines in your mdadm.conf file. You need to only have only HOMEHOST entry in that file.
    Again, here is what I have.
    Code:
    DEVICE partitions
    HOMEHOST ubuntu NAS Server
    MAILADDR xxx.xxxx@gmail.com
    ARRAY /dev/md0 metadata=1.2 UUID=b6afc2db:04e80120:5f5f83c7:5c81958f
    Note: I xxx my email address for privacy.
    Please let me know if is there something wrong I did

    Thank you,
    Spiro
    Last edited by SAngeli; January 31st, 2013 at 03:40 PM.

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

    Re: Ubuntu Server | MDADM | Power Management

    Quote Originally Posted by SAngeli View Post
    Code:
    DEVICESCAN -S on -o on -a -I 194 -m user@gmail.com -s (S/../.././02|L/../../6/03) -n standby,q
    Note: I xxx my email address for privacy.
    You'll want to remove your email from this line too Have you waited a while and then checked if your disks are spinning down? If they are not spinning down, have you verified that the disks support advanced power management? If they don't, the -S flag won't spin them down. You can try to set them up to spin down by hand like this.

    Code:
    hdparm -S 241 /dev/sdb
    Your HOMEHOST line cannot contain spaces, or it interprets it as 3 different HOMEHOSTS.
    Code:
    HOMEHOST ubuntu NAS Server
    could be modified to just
    Code:
    HOMEHOST NAS
    or
    Code:
    HOMEHOST ubuntu-nas
    Last edited by rubylaser; February 5th, 2013 at 03:21 PM.

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

    Re: Ubuntu Server | MDADM | Power Management

    You'll want to remove your email from this line too
    Could you please change the quoted email address to username@gmail.com ?

    Thank you a bunch for pointing this out. This was indeed important.

    Have you waited a while and then checked if your disks are spinning down?
    Yes, I did a test and it does work as you properly say.
    This is the message I get after they went to bed:
    Device is in STANDBY mode, exit(2)
    Thanks for checking on this too!

    I know this is simple but can you please tell me how you obtained 242 for being exactely 60 minutes before it goes into standby? I know it is explained but I fail to identify the multiplier that would need for determining any kind of time.
    Let's say I wish to how to find out for 2 hours or for 3 hours or for 3 1/2 hours.

    Lastly, as for the HOMEHOST I percepted I was unable to add spaces but I was not sure.

    Now, that the server is properly set, I need to focus on:
    - email management
    gmail and also through other providers as I wish to
    use the smtp for web development testing and for my
    mail needs

    - disk performance
    see if it is properly set to get max performance
    - webserver

    For these topics I will start individual Threads.
    See if you can keep an eye on them.

    Thank you for your kind time and help.
    Spiro

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

    Re: Ubuntu Server | MDADM | Power Management

    Hi,

    after I completed mdadm install all is properly working (thanks to forum for this), I realized that ext4 would not be the correct filesystem because I only use this array from Windows and I have few missing features, like icon customization for directories, no NTFS permission memorization, lost+found not usefull,...

    So, after reading on the Internet I decided to move to ntfs (even if many users say it is perfeclty working and many others discourage from using it). It is the ntfs-3g

    So, I first umount the array and than formatted "mkfs.ntfs /dev/md0" Considering that I have 1.5TB HD it took me almost 8 hours I assume to completely format the disks (I do not know if this is correct).
    After turning my Windows PC on, I ssh to the server and I tried to mount the disk but it fails.

    I get this error when I try to " mount -t ntfs-3g /dev/md0 /mnt/array_0". I also tried "mount -t ntfs /dev/md0 /mnt/array_0"

    The error is:
    Code:
    NTFS signature is missing.
    Failed to mount '/dev/md0': Argomento non valido
    The device '/dev/md0' doesn't seem to have a valid NTFS.
    Maybe the wrong device is used? Or the whole disk instead of a
    partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
    What do I have to do? What did I do wrong?

    Here is some useful data if needed:

    Code:
    Disk /dev/sda: 1500.3 GB, 1500301910016 bytes
    81 testine, 63 settori/tracce, 574226 cilindri, totale 2930277168 settori
    Unitą = settori di 1 * 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Identificativo disco: 0x809d0a82
    
    Dispositivo Boot      Start         End      Blocks   Id  System
    /dev/sda1            2048  2930277167  1465137560   fd  Autorilevamento raid di Linux
    
    Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
    81 testine, 63 settori/tracce, 574226 cilindri, totale 2930277168 settori
    Unitą = settori di 1 * 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Identificativo disco: 0x125584aa
    
    Dispositivo Boot      Start         End      Blocks   Id  System
    /dev/sdb1            2048  2930277167  1465137560   fd  Autorilevamento raid di Linux
    
    Disk /dev/md0: 1500.2 GB, 1500166488064 bytes
    2 testine, 4 settori/tracce, 366251584 cilindri, totale 2930012672 settori
    Unitą = settori di 1 * 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Identificativo disco: 0xb62432ae
    
    Dispositivo Boot      Start         End      Blocks   Id  System
    
    Disk /dev/mapper/ubuntu-root: 76.3 GB, 76332138496 bytes
    255 testine, 63 settori/tracce, 9280 cilindri, totale 149086208 settori
    Unitą = settori di 1 * 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Identificativo disco: 0x00000000
    
    Il disco /dev/mapper/ubuntu-root non contiene una tabella delle partizioni valida
    
    Disco /dev/mapper/ubuntu-swap_1: 5364 MB, 5364514816 byte
    255 testine, 63 settori/tracce, 652 cilindri, totale 10477568 settori
    Unitą = settori di 1 * 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Identificativo disco: 0x00000000
    
    Il disco /dev/mapper/ubuntu-swap_1 non contiene una tabella delle partizioni valida
    
    cat /proc/mdstat
    Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md0 : active raid1 sdb1[1] sda1[0]
          1465006336 blocks super 1.2 [2/2] [UU]
    
    unused devices: <none>
    I also created a ubuntu forum thread nobody wants to anser and it is directly related to this issue.
    Please see if you can also answer it.

    Thank you,
    Spiro

  10. #20
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: Ubuntu Server | MDADM | Power Management

    If you are accessing the drive over the network then the filesystem you use has no impact at all, Windows won't know or care what the filesystem is.

    In fact I would highly recommend not using NTFS on a server that only has Ubuntu installed. If you ever have problems that need fixing on an NTFS drive then the only way to fix them is from Windows. Any NTFS problems may be impossible to fix with your current setup.
    Cheesemill

Page 2 of 3 FirstFirst 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
  •