LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   FIle System / Mounting Help For New Partition (https://www.linuxquestions.org/questions/linux-general-1/file-system-mounting-help-for-new-partition-4175489922/)

carlosinfl 01-02-2014 02:01 PM

FIle System / Mounting Help For New Partition
 
I've been asked to attach a new 100 GB partition to our database server and then mount the newly created ext4 partition to /var/lib/pgsql/ directory and set it to auto-mount in /etc/fstab/

I've created a primary single partition /dev/xvdf:

Code:

[root@db1 ~]# fdisk -l

Disk /dev/xvda1: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 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/xvda3: 939 MB, 939524096 bytes
255 heads, 63 sectors/track, 114 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/xvdf: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 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

Here is my /etc/fstab:

Code:

#
LABEL=/                /              ext4    defaults,noatime        1  1
/dev/xvdf              /var/lib/pgsql  ext4    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

Now my confusion / questions are as follows:

1. Why is it not /dev/xvdf1 in my fdisk -l read out?
2. How do I label this partition? Do I use e2label command and if so, what should the label be?

ukiuki 01-02-2014 09:10 PM

Looks like there is no partition in that device. In fstab you have to specify the number of the partition in the device, like you see it for xvda1, xvda3.

Something doesn't looks right there why are your disks ID 0x00000000 the same?
Did you remove part of the info from fdisk output? I don't see the part where it says what type the partitions are.

Create the partition with fdisk and then,
to format the partition as ext4 on xvdf, issue the following command as root:
Code:

# mkfs.ext4 /dev/xvdf1
To label it(replace label with the name you want):
Code:

# e2label /dev/xvdf1 /label
Regards


All times are GMT -5. The time now is 04:28 AM.