Disk partitioning commands for RHEL5

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Disk partitioning commands for RHEL5
# 1  
Old 08-30-2010
Disk partitioning commands for RHEL5

I'm new to Linux 5, going through initial phases of installation and setting up devices, etc,, and much to my surprise discovered also an existence of a 2nd hard drive to try to initialize and partition perhaps using any built-in command i.e. "fdisk" or similar, but I couldn't get the command to work. I'm currently using bash shell. What could I be missing, other than a brain? Any help or suggestion would be much appreciated. Thank you.

Last edited by su; 08-30-2010 at 07:55 PM..
# 2  
Old 08-30-2010
Code:
fdisk
lvmdiskscan
pvcreate
vgcreate
lvcreate
mkfs
vgextend
lvextend
resize2fs
pvs
pvdisplay
vgdisplay
lvdisplay
df
mount

# When adding a new disk...
for S in $(ls /sys/class/scsi_host); do
  echo "- - -" > /sys/class/scsi_host/$S/scan
done

# 3  
Old 08-31-2010
Also, as a point of note, You are using Red Hat Enterprise Linux 5 (with a minor version that you omitted). Linux is too general, so as to not confuse you, or others, or start a flame fest about which distribution is better, you may want to be more specific (Besides just posting in the Red Hat section).

Truth be told, Linux is on 2.6. That is the version of the kernel, which is, by all rights, what "Linux" is.

For most physical drives, I like to run the following command:

lvmdiskscan | grep -v ram

However, if the drives have not been detected for some reason (you may want to restart udevd) you could run the command at the end of Scott's informative list:

Quote:
for S in $(ls /sys/class/scsi_host); do
echo "- - -" > /sys/class/scsi_host/$S/scan
done
# 4  
Old 08-31-2010
...and although highly recommended, it's not necessary to configure an LVM though... you can just fdisk the drive with a standard Linux native format (usually 0x83) and create the filesystem with mkfs or something similar.
# 5  
Old 09-01-2010
Thank you all for your helpful insights. i hope to relearn new scripting skills and be of help as you have all been for me and to this posting. The kernel version of EL5 I use is 2.6 as well which came bundled for their newer Oracle 11g R2 all free downloads from their home site. The gist of my bewilderment came from the failed execution of the 'fdisk' command. I checked for the full pathname to make sure the command exists, but then I should have made sure the path is appended in $PATH, which in my case it didn't, and fixing it there made it work. If it didn't, I would have just as well reinstall the command file assuming corruption as culprit. I'll have more days like this. Thanks again - and stay healthy!

Last edited by su; 09-01-2010 at 06:24 PM.. Reason: Inconsistent reference information provided
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Which is a recommended method of partitioning Disk?

I m not sure if this is a right question to ask . During the installation of the OS, installation sw does partitioning for you. I m not quit sure if they have used parted or fdisk to partition the disk. (If they are using fdisk then you can't make partition > 2Tb )correct me if i m wrong.Also... (5 Replies)
Discussion started by: pinga123
5 Replies

2. Red Hat

Partitioning newly added disk to Redhat

Hi Everyone, I have added new Virtual disk to OS. The main point is I need to bring this whole Disk into LVM control, is it necessary to partition the disk using fdisk command and assign partition type as '8e', or can I directly add that disk into LVM, by running pvcreate command with out... (2 Replies)
Discussion started by: bobby320
2 Replies

3. Solaris

Partitioning hard disk. Want 8 slices...have 9

Hi all I'm having difficulty setting up a proper disk structure on a 72GB HDD. The drive was previously part of a zfs pool. The zpool has ben destroyed and now I want to use the disk in a raid 5 array. I need to partition the disk accordingly though. This is what the partition table currently... (7 Replies)
Discussion started by: notreallyhere
7 Replies

4. Solaris

disk partitioning

Total disk size is 38912 cylinders Cylinder size is 32130 (512 byte) blocks Cylinders Partition Status Type Start End Length % ========= ====== ============ ===== === ====== === ... (2 Replies)
Discussion started by: seyiisq
2 Replies

5. Shell Programming and Scripting

need help in disk space commands

hy i have written a K-shell script that will calculate the number of Disk space used by all the directories under the HOMe dir #!/bin/ksh cd /ednpdtu3/u01/pipe count=`ls -ltr | grep ^d | wc -l` echo "$count Dir found in HOME DIR" a1=1 while do b=`ls -ltr | grep ^d | head -$a1 |... (2 Replies)
Discussion started by: ali560045
2 Replies

6. Shell Programming and Scripting

Partitioning script for rescue mode (disk size calculation)

Hello! I need to write partitioning script wich would work in rescue mode. It will prepare partitions and unpack linux on it. However I need to calculate whole size of the disk and create: /dev/sda1 --> One big partition (minus (2*size of memory) for swap) /dev/sda2 --> Swap partition... (1 Reply)
Discussion started by: pug123
1 Replies

7. UNIX for Advanced & Expert Users

Help: Sun Disk partitioning for Sun V240 & StorEdge 3300

Dear Sun gurus, I have Sun Fire V240 server with its StorEdge 3300 disk-array. Following are its disks appeared in format command. I have prepared its partitions thru format and metainit & metattach (may be i have made wrong steps, causing the errors below because I have done thru some document... (1 Reply)
Discussion started by: shafeeq
1 Replies

8. Linux

Commands for OS patch, processor and disk partition

Hi All, Can anybody please help me with finding commands on LINUX for the following: processor: Availability PowerManagementSupported Description also for OS patch i need to know the following info: SeverityRating ServicePackInEffect for disk partition: Description BlockSize ... (1 Reply)
Discussion started by: Veenak15
1 Replies

9. UNIX for Dummies Questions & Answers

Hard Disk partitioning to use UNIX

Hello, To run UNIX, can the hard disk be partitioned so I could use that part for UNIX and the other for my existing Windows '98? At the moment there are hard drives C: & D:. Also, where can I obtain the UNIX software?.....Your response is appreciated. (2 Replies)
Discussion started by: hpin
2 Replies
Login or Register to Ask a Question