Vous êtes sur la page 1sur 11

Good Morning.

For upgrade, Iteration 1, for Development Environment, which will be with 2 Servers, whereas,
1 server is for Database and the other server is for Application.

Database Server:

OS Oracle Linux 5.9


RAM 16 GB
Hardisk 500 GB

Application Server:

OS Oracle Linux 5.9


RAM 16 GB
Hardisk 300 GB

File System:
File System should be same as Production, and in addition provide three file systems
for 12.2

fs1 (APPL_TOP+ INST_TOP) 100 G


fs2 (APPL_TOP+ INST_TOP) 100 G
fs_ne 20 G
Existing Production 80 G

Kindly provide the same and confirm when it is ready.


Redhat Linux – Creating New Partition table
and Filesystem on SAN disk
1. List the available disks / LUNs with the following command:

# fdisk –l

2. Run the fdisk command against the applicable disk you wish to partition. In this instance we
use the example sdb which is the second available disk on this platform:

# fdisk /dev/sdb
Replace ‘sdb’ with the device which represents the disk you wish to modify.

3. Type ‘o’ and press enter to create a new, blank, DOS-style partition table. After doing so, you
can type ‘p’ to display the blank partition table, which will appear as the following:

Command (m for help): p

Disk /dev/sdb: 9100 MB, 9100044288 bytes


255 heads, 63 sectors/track, 1106 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help):

4. Press ‘n’ and then enter to create a new partition. You will be prompted for several pieces of
information including if to create a primary or extended partition (choose primary), which
partition number, and how large of a partition to create. The default values will be to create a
partition as large as the entire disk:

Command (m for help): n


Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1106, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-1106, default 1106): 1106
After doing so, ‘p’ should show a single partition occupying the entire disk:

Command (m for help): p


Disk /dev/sdb: 9100 MB, 9100044288 bytes
255 heads, 63 sectors/track, 1106 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System


/dev/sdb1 1 1106 8883913+ 83 Linux

5. Write out the changes to the disk by pressing ‘w’ and then enter. This will cause fdisk to exit
and return to the command prompt. The command ‘partprobe’ should then be run, or the system
restarted, to ensure that the kernel is notified of any partition table changes.

6. A file system can then be created using whatever options are desired on the partition.

For example, to create an ext3 file system one would run:

# mkfs.ext3 /dev/sda1

Republished by Blog Post Promoter

Let’s Resize Partition and Filesystem with


fdisk and resize2fs!

http://geekpeek.net/resize-filesystem-fdisk-
resize2fs/

Our system has two disks:

 /dev/sda – 16GB system disk with LVM partitions (root and swap)
 /dev/sdb – 1GB clean disk for tutorial purpose
For the start of this tutorial tutorial we have created one partition on /dev/sdb disk. Partition
size (/dev/sdb1) is 500MB. We created an ext4 filesystem on this partition and put some dummy
data on it. We will be modifying our partitions with fdisk and filesystem with resize2fs.

For more information on how to create and modify partitions with fdisk read “Linux partitioning
with fdisk on CentOS 6“.

Extend Partition and Filesystem


Before we start, let’s check the current disk configuration. Geekpeek mount point is the partition
we want to extend. We can see that the partition has 494MB of available space and 401MB is
already used by dummy data. We want to extend the partition to 1GB:

[root@foo1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_foo-LogVol01
13G 4.6G 7.7G 38% /
tmpfs 376M 0 376M 0% /dev/shm
/dev/sda1 485M 105M 355M 23% /boot
/dev/sdb1 494M 402M 67M 86% /geekpeek

1. Unmount the partition


[root@foo1 ~]# umount /geekpeek/
[root@foo1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_foo-LogVol01
13G 4.6G 7.7G 38% /
tmpfs 376M 0 376M 0% /dev/shm
/dev/sda1 485M 105M 355M 23% /boot

2. Delete the partition


[root@foo1 ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to


switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): d


Selected partition 1

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes


255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2dbb9f13

Device Boot Start End Blocks Id System

Command (m for help): w


The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

3. Create a new (larger) partition


[root@foo1 ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to


switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): n


Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First sector (2048-2097151, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
Using default value 2097151

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes


255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x2dbb9f13

Device Boot Start End Blocks Id System


/dev/sdb1 2048 2097151 1047552 83 Linux

Command (m for help): w


The partition table has been altered!

Calling ioctl() to re-read partition table.

We are able to mount the partition at this point, but the filesystem on this partition is only
500MB large. We need to resize the filesystem using resize2fs command in the following steps.

4. Run fsck on your filesystem

[root@foo1 ~]# e2fsck -f /dev/sdb1


e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 16/130560 files (0.0% non-contiguous), 426988/522080 blocks
5. Resize your filesystem with resize2fs
[root@foo1 ~]# resize2fs /dev/sdb1
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/sdb1 to 1044192 (1k) blocks.
The filesystem on /dev/sdb1 is now 1044192 blocks long.

6. Re-mount extended partition


[root@foo1 ~]# mount /dev/sdb1 /geekpeek/
[root@foo1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_foo-LogVol01
13G 4.6G 7.7G 38% /
tmpfs 376M 0 376M 0% /dev/shm
/dev/sda1 485M 105M 355M 23% /boot
/dev/sdb1 988M 402M 536M 43% /geekpeek

Voila! The partition was successfully extended, as we can see all of the data survived! Always
remember to resize the filesystem with resize2fs.

Reduce a Partition and Filesystem


Reviewing the current disk configuration: Geekpeek mount point is the partition we want to
reduce. We can see that the partition has 988MB of available space and 324MB is used by
dummy data. We want to reduce the partition to 400MB without loosing data:

[root@foo1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_foo-LogVol01
13G 4.6G 7.7G 38% /
tmpfs 376M 0 376M 0% /dev/shm
/dev/sda1 485M 105M 355M 23% /boot
/dev/sdb1 988M 324M 614M 35% /geekpeek

1. Unmount the partition


[root@foo1 ~]# umount /geekpeek/
[root@foo1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_foo-LogVol01
13G 4.6G 7.7G 38% /
tmpfs 376M 0 376M 0% /dev/shm
/dev/sda1 485M 105M 355M 23% /boot

2. Run fsck on your filesystem


[root@foo1 ~]# e2fsck -f /dev/sdb1
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 15/261120 files (0.0% non-contiguous), 363953/1044192 blocks
3. Resize the filesystem with resize2fs
[root@foo1 ~]# resize2fs /dev/sdb1 400M
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/sdb1 to 409600 (1k) blocks.
The filesystem on /dev/sdb1 is now 409600 blocks long.

4. Delete the partition


[root@foo1 ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to


switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): d


Selected partition 1

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes


255 heads, 63 sectors/track, 130 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: 0x2dbb9f13

Device Boot Start End Blocks Id System

Command (m for help): w


The partition table has been altered!

Calling ioctl() to re-read partition table.


Syncing disks.

4. Create a new (smaller) partition


[root@foo1 ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to


switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): n


Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130): +400M

Command (m for help): p

Disk /dev/sdb: 1073 MB, 1073741824 bytes


255 heads, 63 sectors/track, 130 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: 0x2dbb9f13

Device Boot Start End Blocks Id System


/dev/sdb1 1 52 417658+ 83 Linux

Command (m for help): w


The partition table has been altered!

Calling ioctl() to re-read partition table.


Syncing disks.

5. Mount the new partition and filesystem


[root@foo1 ~]# mount /dev/sdb1 /geekpeek/
[root@foo1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_foo-LogVol01
13G 4.6G 7.7G 38% /
tmpfs 376M 0 376M 0% /dev/shm
/dev/sda1 485M 105M 355M 23% /boot
/dev/sdb1 388M 323M 45M 88% /geekpeek

Voila! The partition was successfully reduced to 400MB, as we can see all of the data survived!
Always remember to resize the filesystem with resize2fs.
http://www.dell.com/downloads/global/power/ps3q06-20060189-Michael.pdf

To Enable Multipathing in Linux


1. Attach a J4500 array to a server with a supported version of Linux installed.
2. On the server, edit or create the /etc/multipath.conf file.
3. Reboot the server.
4. After the reboot, make sure that the OS discovers all the disks in the J4500 array either by using the
Linux commands, fdisk or lsscsi.
5. Partition any disks you want to the desired sizes.
6. Use the Linux command modprobe to add the loadable kernel modules dm-multipath and dm-round-
robin.

# modprobe dm-multipath

# modprobe dm-round-robin

7. Start the multipathd daemon.

For Linux SUSE 9, use the following command:

# multipathd -v0

For other supported Linux versions, use the following command:

# service multipathd start

8. Start the multipathing device mapper target autoconfig.

# multipath -v2

9. List the multipath devices that have been created.

# multipath -ll

The output should list the same number of devices as there are disks in the J4500 array. The following is an
example of output:
35000c5000357625b dm-2 SEAGATE,ST340008SSUN0.4
[size=373G][features=0][hwhandler=0]
\_ round-robin 0 [prio=2][active]
\_ 0:0:0:0 sda 8:0 [active][ready]
\_ 1:0:0:0 sdm 8:192 [active][ready]

To Disable Multipathing in Linux


1. If a RAID volume, LVM volume, or volume mount have been placed over the device node of the
multipathed disk, quiesce the volume.
2. Use the multipath -f command to disable multipathing to a specific device.

# multipath -f mpath1

3. Use the multipath -F command to disable multipathing on all multipathed devices.

# multipath -F

Making partition

Step 1

Step 2

Make fdisk

Make size etc

Step 3 :

Register with
Step 4 :

Make dir and Make file system and format

mount -o remount,rw /

Vous aimerez peut-être aussi