Find the answer to your Linux question:
Results 1 to 10 of 10
Hi. I am running a debian linux on my server, without GUIs, just a terminal. The server provider "said" that my server has 2 HDDs. But I have not idea ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2013
    Posts
    5

    How to access the second hard drive?


    Hi.

    I am running a debian linux on my server, without GUIs, just a terminal. The server provider "said" that my server has 2 HDDs. But I have not idea how to use my second HDD. Maybe when I use my linux the files are automatically distributed between those two drives?
    I used search function here with keyword "hard drive" and got no results. I've used google and I got some outdated information from year 2005.

    Any help or hint is appreciated.

    Thanks.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    Hi and welcome

    It depends how these disks are setup.
    As single disks, software or hardware raid.

    To find out, please post the output of the following commands in CODE tags.
    Code:
    lspci
    parted -l
    fdisk -l
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Mar 2013
    Posts
    5
    lspci:
    Code:
    00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor DR                                                                                                                     AM Controller (rev 09)
    00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI                                                                                                                      Express Root Port (rev 09)
    00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Cor                                                                                                                     e processor Graphics Controller (rev 09)
    00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                                                                                                                     B xHCI Host Controller (rev 04)
    00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset                                                                                                                      Family MEI Controller #1 (rev 04)
    00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                                                                                                                     B Enhanced Host Controller #2 (rev 04)
    00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Ex                                                                                                                     press Root Port 1 (rev c4)
    00:1c.4 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Ex                                                                                                                     press Root Port 5 (rev c4)
    00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family US                                                                                                                     B Enhanced Host Controller #1 (rev 04)
    00:1f.0 ISA bridge: Intel Corporation H77 Express Chipset LPC Controller (rev 04                                                                                                                     )
    00:1f.2 SATA controller: Intel Corporation 7 Series/C210 Series Chipset Family 6                                                                                                                     -port SATA Controller [AHCI mode] (rev 04)
    00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Contr                                                                                                                     oller (rev 04)
    03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI E                                                                                                                     xpress Gigabit Ethernet controller (rev 09)
    parted -l .. not found
    Code:
    -bash: parted: command not found
    fdisk -l
    Code:
    WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
    
    
    Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
    256 heads, 63 sectors/track, 363376 cylinders, total 5860533168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1  4294967295  2147483647+  ee  GPT
    Partition 1 does not start on physical sector boundary.
    
    WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
    
    
    Disk /dev/sda: 3000.6 GB, 3000592982016 bytes
    256 heads, 63 sectors/track, 363376 cylinders, total 5860533168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1  4294967295  2147483647+  ee  GPT
    Partition 1 does not start on physical sector boundary.
    
    Disk /dev/md0: 34.4 GB, 34358616064 bytes
    2 heads, 4 sectors/track, 8388334 cylinders, total 67106672 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/md0 doesn't contain a valid partition table
    
    Disk /dev/md1: 536 MB, 536858624 bytes
    2 heads, 4 sectors/track, 131069 cylinders, total 1048552 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/md1 doesn't contain a valid partition table
    
    Disk /dev/md2: 1099.5 GB, 1099510439936 bytes
    2 heads, 4 sectors/track, 268435166 cylinders, total 2147481328 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/md2 doesn't contain a valid partition table
    
    Disk /dev/md3: 1866.2 GB, 1866181442560 bytes
    2 heads, 4 sectors/track, 455610703 cylinders, total 3644885630 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000
    
    Disk /dev/md3 doesn't contain a valid partition table

  4. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    Ok, so you do have two 3TB disks, arranged in a software raid.

    You can further investigate with
    Code:
    mdadm --detail --scan
    or
    cat /proc/mdstat
    As to what is mounted where:
    Code:
    mount
    cat /etc/fstab
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Mar 2013
    Posts
    5
    mdadm --detail --scan
    Code:
    ARRAY /dev/md/0 metadata=1.2 name=rescue:0 UUID=b516653d:d7860c90:66a8b18d:6a3f05ec
    ARRAY /dev/md/1 metadata=1.2 name=rescue:1 UUID=ac49456d:28fc4917:65d6d34f:c61bc8ad
    ARRAY /dev/md/2 metadata=1.2 name=rescue:2 UUID=25fbc380:732181f4:47b2f62a:a1d826d6
    ARRAY /dev/md/3 metadata=1.2 name=rescue:3 UUID=2f13b449:d3ac179a:621d7507:6d6499c8
    cat /proc/mdstat
    Code:
    Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
    md3 : active raid1 sda4[0] sdb4[1]
          1822442815 blocks super 1.2 [2/2] [UU]
    
    md2 : active raid1 sda3[0] sdb3[1]
          1073740664 blocks super 1.2 [2/2] [UU]
    
    md1 : active raid1 sda2[0] sdb2[1]
          524276 blocks super 1.2 [2/2] [UU]
    
    md0 : active raid1 sda1[0] sdb1[1]
          33553336 blocks super 1.2 [2/2] [UU]
    
    unused devices: <none>
    mount
    Code:
    sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
    proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
    udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=2018158,mode=755)
    devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
    tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=1615852k,mode=755)
    /dev/disk/by-uuid/1420b151-979c-4a12-8349-2fe2acc0115f on / type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
    tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
    tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=9942360k)
    /dev/md1 on /boot type ext3 (rw,relatime,errors=continue,barrier=1,data=ordered)
    /dev/md3 on /home type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
    gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
    fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
    cat /etc/fstab
    Code:
    proc /proc proc defaults 0 0
    none /dev/pts devpts gid=5,mode=620 0 0
    /dev/md/0 none swap sw 0 0
    /dev/md/1 /boot ext3 defaults 0 0
    /dev/md/2 / ext4 defaults 0 0
    /dev/md/3 /home ext4 defaults 0 0
    OK, so does it mean it's located in "/dev/md/" or "/dev/mdx/" (x for number)?
    Also it means that different directories are on different disks?
    Why does it displaying as 4 disks insted of 2?

    Edit: I just checked it, the "/dev/mdx" are files. The "/dev/md" are some strange shortcuts which I don't have a access.
    Does it means that one disk is on boot and other at home? But it sounds strange to add files in boot folder ..

  6. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    You can see the md devices as an abstraction layer.
    • Your two disks are divided in four partitions.
    • The layout and size of these partitions is identical on both disks.
    • Then each counterparts are assembled as a md device, which results in four md devices.
    • All four of your md devices are configured as raid1, aka mirroring.
    • This means, if one disk dies, then your data is still available (Of course, you must replace the broken disk then)

    • linux uses one directory tree. Each directory can potentially be mounted to a device.
    • This is quite versatile and allows adaption to various usecases. In your case, most of the space (1,8TByte) is in /home.
    You must always face the curtain with a bow.

  7. #7
    Just Joined!
    Join Date
    Mar 2013
    Posts
    5
    hm .. so it means that the same data is saved on both disks and they act as one?

  8. #8
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    Yes.
    A software raid1 provides data redundancy and higher read speed
    in trade of available space (A 3TByte raid1 needs 2x3TByte space) and some cpu power (The raid logic needs processing).
    You must always face the curtain with a bow.

  9. #9
    Just Joined!
    Join Date
    Mar 2013
    Posts
    5
    Oh ... ok, I understand now. I had no clue about RAID

    Thank you.

  10. #10
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,382
    yw.
    If you want to know more,
    wikipedia has a nice article on raids in general https://en.wikipedia.org/wiki/RAID
    and linux software raid https://en.wikipedia.org/wiki/Mdadm

    Be aware though, that having a raid is one thing. Monitoring it the other.
    You need to be informed, when a disk fails so that you can react.
    It is quite easy to run a monitor with mdadm and let it send a mail in case of a failure.
    You must always face the curtain with a bow.

Posting Permissions

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