Solved

LVM & device not found

Posted on 2006-10-30
2
1,104 Views
Last Modified: 2013-12-15
I have an extra hard disk in my server that was formatted with extfs3 and mounted in the filesystem.  The drive has nothing on it and I'm not learning about setting up LVM partitions.  So I unmounted the partition /dev/sda1 and ran the command "pvcreate /dev/sda" but it tells me "Device /dev/sda not found".  Can't I just put the whole drive under LVM instead of just a partition?

0
Comment
Question by:phasevar
2 Comments
 
LVL 1

Accepted Solution

by:
q_shakur earned 500 total points
ID: 17838927
>>Can't I just put the whole drive under LVM instead of just a partition?<<
yes you can,
but first you have to know that using LVM assumes that the disk or disks you will be using do not have a formatted partition. In Linux you would use the fdisk to remove the partition, note that this thing will remove all the data, in your case there is nothing to lose your HD is empty and you dont use it at all.

next to use the whole disk in LVM, you can do this command :
# dd if=/dev/zero of=/dev/sda bs=1K count=1
see /dev/sda --> its your HD, be sure its the HD that you want to use, the above command will erase the partition table by zeroing the fist sector.
then type this command :
# blockdev --rereadpt /dev/sda
this will call block device ioctls with reread partition table for your /dev/sda HD

now as i think every thing is ok you can run the command :
# pvcreate /dev/sda
now should be no problem so you can continue by vgcreate, lvcreate ...
0
 

Author Comment

by:phasevar
ID: 17838992
Thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question