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.
Best Answer
/dev/xvdb
is a disk device, and/dev/xvdb1
is first partition on axvdb
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.