1

I wanna make a new volume available on Linux, then I've read AWS's doc and rackspace's doc. I find that there is a little different.

AWS's doc tell the setp this:

  • format the volume mkfs -t ext4 /dev/xvdb
  • mount the volume at mount point directory ```mount /dev/xvdb /mnt/data
  • mount the volume on start

    vi /etc/fstab

    /dev/xvdb /mnt/my-data ext4 defaults,nofail 0 2

But rackspace's doc tell the step this:

  • make a partition on the volume fdisk /dev/xvdb
  • format the volume mkfs -t ext4 /dev/xvdb1
  • mount the volume at mount point directory ```mount /dev/xvdb1 /mnt/data
  • auto mount the volume on startup

    vi /etc/fstab /dev/xvdb1 /mnt/my-data ext4 defaults,nofail 0 2

The different is AWS use volume directly, but rackspace partition the volume and use the partiton. I wanna know if I can use the volume directly, why I need the partition? What is different between use /dev/xvdb and /dev/xvdb1?

Thank you.

greyby
  • 45
  • 1
  • 1
  • 2
  • The difference is that the instructions were written by different people with different levels of competence or philosophical position. – womble Sep 25 '15 at 04:39

1 Answers1

1

/dev/xvdb is a disk device, and /dev/xvdb1 is first partition on a xvdb device. Although you can probably use the whole disk for a filesystem, and this may work in lot of cases (furthermore, often this is a valid approach), usually filesystems should reside inside a partition, so various utilities and software (and primarily - fsck) could recognize them by their disk label, which is set accordingly. We're tallking here about extN family of filesystems - this rule applies to them.

drookie
  • 8,625
  • 1
  • 19
  • 29
  • fsck, the kernel, etc, are more than capable of reading the filesystem label out of a filesystem located on a whole disk block device. – womble Sep 25 '15 at 04:39
  • yeah, and the main reason that every linux distro isn't using dedicated disks is some sort of inability to see evident, right ? – drookie Sep 25 '15 at 04:44
  • I... don't know what to say to that. Mostly because I have no idea what you're trying to say. – womble Sep 25 '15 at 04:48
  • I can see this. – drookie Sep 25 '15 at 05:11
  • If I just want one big filesystem on a disk, I don't bother with the overhead of partitions. Same goes for component devices of MD raid. Distros don't do this because it could cause confusion (and on the primary disk you usually do want a separate /boot partition). – wurtel Sep 25 '15 at 07:49
  • First - various legacy tools like fdisk won't complain about missing partition table. And yeah, 16Kb is an enormous overhead. Considering you have to align partitions to 4k on AF drives, - yeah, 16 Kb economy on a 2Tb disk makes just perfect sense. – drookie Sep 25 '15 at 08:40