1
[root@localhost ~]# fdisk -l

Disk /dev/xvdb: 2147.5 GB, 2147483648000 bytes
255 heads, 63 sectors/track, 261083 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00050ec0

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvdb2              64      261084  2096638976   8e  Linux LVM

Disk /dev/xvda: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000effaf

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64         653     4729856   8e  Linux LVM
Partition 2 does not end on cylinder boundary.

Disk /dev/mapper/VolGroup-lv_swap: 16.8 GB, 16844324864 bytes
255 heads, 63 sectors/track, 2047 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup00-lv_root: 4303 MB, 4303355904 bytes
255 heads, 63 sectors/track, 523 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup00-lv_swap: 536 MB, 536870912 bytes
255 heads, 63 sectors/track, 65 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_home: 2076.4 GB, 2076423749632 bytes
255 heads, 63 sectors/track, 252444 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@localhost ~]#

Mounted Drives

[root@localhost ~]# df
Filesystem           1K-blocks   Used Available Use% Mounted on
/dev/mapper/VolGroup00-lv_root
                       4005360 780156   3015080  21% /
tmpfs                  1475396      0   1475396   0% /dev/shm
/dev/xvda1              487652  52811    409241  12% /boot
[root@localhost ~]#

Screenshot of XenServer attached drives

Hard Drives

How can I attach this drive 2TB hard drive to /mnt/? I thought mount -t ext2 /dev/xvdb /mnt would work but everything I try fails

/etc/fstab

#
# /etc/fstab
# Created by anaconda on Sun Aug 23 19:29:26 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup00-lv_root /                       ext4    defaults        1 1
UUID=b9b08863-9a52-432a-b904-61a3144ce709 /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0
/dev/mapper/VolGroup00-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

Mounted drives

[root@localhost ~]# mount
/dev/mapper/VolGroup00-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/xvda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

uuid

[root@localhost ~]# ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 31de66c0-cd8f-4f75-9bf6-7194dc43dafd -> ../../dm-4
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 35a57414-2271-4db2-9f9a-09cf36c19044 -> ../../dm-0
lrwxrwxrwx. 1 root root 11 Aug 23 21:37 5a99aec9-7270-44ce-9df7-32ff4d70a75b -> ../../xvdb1
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 986339d2-abd7-453f-8422-e8c1acb9368a -> ../../dm-2
lrwxrwxrwx. 1 root root 11 Aug 23 21:37 b9b08863-9a52-432a-b904-61a3144ce709 -> ../../xvda1
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 c065a889-055d-44f2-bae4-0ac73d86d493 -> ../../dm-1
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 e85cb70e-6403-4b06-a481-a1512140a491 -> ../../dm-3
1

Your command is attempting to mount the device, rather than the partition.

Instead of mount -t ext2 /dev/xvdb /mnt, try using:

mount -t ext4 /dev/xvdb2 /mnt

If you would like to automatically mount this partition at boot, you will also need to add the partition to your fstab file.

You need to know the UUID of your disk, which you can find with ls -l /dev/disk/by-uuid/, then looking for your 2TB drive. This appears to be 5a99aec9-7270-44ce-9df7-32ff4d70a75b for your disk.

Then you will need to edit /etc/fstab and add the following line:

UUID=5a99aec9-7270-44ce-9df7-32ff4d70a75b /mnt ext4 defaults 1 2

There is a comprehensive guide for Ubuntu here: https://help.ubuntu.com/community/AutomaticallyMountPartitions

  • "mount: /dev/xvdb2 already mounted or /mnt busy" – Teddy291 Aug 24 '15 at 2:00
  • You can type mount to see your current mount points - this will allow you to either browse to the mount location, or type umount </your/unwanted/mountpoint> to unmount the disk. If /mnt is already is use by another partitoin, then you will need to create a new directory to mount the partition in, for example mkdir /mnt2 or mkdir /2tb – Daneel Aug 24 '15 at 2:05
  • I can't find the mounted 2TB drive. I have updated my first post. – Teddy291 Aug 24 '15 at 2:08
  • Can you add the output of ls -l /dev/disk/by-uuid? – Daneel Aug 24 '15 at 2:11
  • Ok, added above. – Teddy291 Aug 24 '15 at 2:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.