Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I get this after running fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         522     4192933+  83  Linux
/dev/sda2             523       60540   482094585   83  Linux
/dev/sda3           60541       60801     2096482+  82  Linux swap / Solaris

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14       60801   488279610   8e  Linux LVM

and my df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             446G  397G   27G  94% /
/dev/sda1             3.9G   84M  3.6G   3% /boot
tmpfs                 2.0G     0  2.0G   0% /dev/shm

Can I get step-by-step instructions for mounting this hard disk? I tried search online but everything seems to be different from what I have. Also, what directory should I mount to if I want the files to be accessible by apache?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14       60801   488279610   8e  Linux LVM

As I understand, you want to mount the /dev/sdb2. Pay attention to the Id and System columns, it shows 8e and LVM volume. You cannot mount it in the same way as you did with standard partition (ext3, ext4, ...)

List all physical volumes with:

# pvs
  PV         VG         Fmt  Attr PSize   PFree
  /dev/sda2  VolGroup00 lvm2 a-   931.41G    0 
  /dev/sdb2  VolGroup00 lvm2 a-   931.50G    0 

Next, list the logical volumes in VolGroup00:

# lvdisplay /dev/VolGroup00
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                Eq8ceD-6A07-lfTw-QHoB-l8Hj-Rz0l-Ijsoro
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                1.81 TB
  Current LE             59175
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                pQG1xT-0PTT-xn35-QdVd-67Di-zYmr-xkb3WK
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                13.69 GB
  Current LE             438
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

Take a look at the LV Size and mount the logical volume you want:

mount /dev/VolGroup00/LogVol00 /mnt/data

To make Apache can write to this folder:

chown -R apache:apache /mnt/data

If there is no existing data, and you want to format it as a 'normal' partition, do it with:

fdisk /dev/sdb

and follow the prompt.

Create an ext3 filesystem:

mkfs.ext3 /dev/sdb1

Mount it:

mount /dev/sdb1 /mnt/data
share|improve this answer
    
Why does my pvs command display nothing? –  Matthew Hui Sep 4 '11 at 16:16
    
Also does sdb1 need to be mounted –  Matthew Hui Sep 4 '11 at 16:26
1  
Could you please run lvm vgchange -ay and try again. About the /dev/sdb1, take notice of Boot column, it used to be a /boot partition. So, you don't need to mount it. Do you takeover this server from previous Sysadmin? –  quanta Sep 4 '11 at 17:03
    
My friend who was helping me called mkfs.ext3 on sdb1 and sdb2 and then mount on both. How can I backtrack and do what you taught me? I have no experience with sysadmin and this is my first server –  Matthew Hui Sep 4 '11 at 17:56
1  
Do you want to keep existing data if it has? –  quanta Sep 5 '11 at 0:51
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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