The Ubuntu Kernel Team has released a call for testing for a set of RC6 power saving patches for Ubuntu 12.04 Precise Pangolin LTS. Quoting Leann Ogasawara's email to the ubuntu kernel team and ubuntu-devel mailing lists:
"Hi All,
RC6 is a technology which allows the GPU to go into a very low power consumption state when the GPU is idle (down to 0V). It results in considerable power savings when this stage is activated. When comparing under idle loads with machine state where RC6 is disabled, improved power usage of around 40-60% has been witnessed [1].
Up until recently, RC6 was disabled by default for Sandy Bridge systems due to reports of hangs and graphics corruption issues when RC6 was enabled. Intel has now asserted that RC6p (deep RC6) is responsible for the RC6 related issues on Sandy Bridge. As a result, a patch has recently been submitted upstream to disable RC6p for Sandy Bridge [2].
In an effort to provide more exposure and testing for this proposed patch, the Ubuntu Kernel Team has applied this patch to 3.2.0-17.26 and newer Ubuntu 12.04 Precise Pangolin kernels. We have additionally enabled plain RC6 by default on Sandy Bridge systems so that users can benefit from the improved power savings by default.
We have decided to post a widespread call for testing from Sandy Bridge owners running Ubuntu 12.04. We hope to capture data which supports the the claims of power saving improvements and therefore justify keeping these patches in the Ubuntu 12.04 kernel. We also want to ensure we do not trigger any issues due to plain RC6 being enabled by default for Sandy Bridge.
If you are running Ubuntu 12.04 (Precise Pangolin) and willing to test and provide feedback, please refer to our PowerManagementRC6 wiki for detailed instructions [3]. Additionally, instructions for reporting any issues with RC6 enabled are also noted on the wiki. We would really appreciate any testing and feedback users are able to provide.
Thanks in advance,
The Ubuntu Kernel Team"
So please contribute to this call for testing by visiting
https://wiki.ubuntu.com/Kernel/PowerManagementRC6
and follow the instructions.
Thank you!
Hack Free || die()
Tuesday, February 21, 2012
Tuesday, March 15, 2011
How To Have udev Run A Script
Ubuntu uses the udev system to handle devices such as USB connected peripherals. By creating a udev rule, you can have a script run when you plug something into a USB port. This can be helpful if you want to have a script automatically copy data off the USB stick as one example.
To create a new udev rule, you need to get the product and manufacturer information after the USB device is connected. To get that information, you first need to identify the block device node that was assigned after connecting the USB device. This can be done with the following steps:
1. Connect USB device.
2. Run the command:
$ dmesg
Now look for the device name. The following is an example:
[201777.817900] usb 1-1.2: new high speed USB device using ehci_hcd and address 23
[201778.012085] usb 1-1.2: selecting invalid altsetting 1
[201778.012535] scsi27 : usb-storage 1-1.2:1.0
[201779.005735] scsi 27:0:0:0: Direct-Access USB Flash Memory 1.00 PQ: 0 ANSI: 2
[201779.006925] sd 27:0:0:0: Attached scsi generic sg3 type 0
[201779.010271] sd 27:0:0:0: [sdd] 7823296 512-byte logical blocks: (4.00 GB/3.72 GiB)
[201779.010909] sd 27:0:0:0: [sdd] Write Protect is off
[201779.010917] sd 27:0:0:0: [sdd] Mode Sense: 0b 00 00 08
[201779.010923] sd 27:0:0:0: [sdd] Assuming drive cache: write through
[201779.013841] sd 27:0:0:0: [sdd] Assuming drive cache: write through
[201779.014673] sdd: sdd1 <---- THIS IS THE DEVICE NAME.
[201779.016085] sd 27:0:0:0: [sdd] Assuming drive cache: write through
[201779.016100] sd 27:0:0:0: [sdd] Attached SCSI removable disk
In the previous example you can see the block device node name is sdd. Once you have this name, you can get the product and manufacturer information. This can be done with the udevadm command:
udevadm info --attribute-walk --name /dev/sdd1 > /tmp/udevadm.out
The udevadm command reports allot of information, so I have it redirect the output to a file. After running the udevadm command, I edit the file with vi (Use your preferred editor), and search for the strings product and manufacturer. In the previous example, it is reported as the following:
ATTRS{product}=="USB Flash Memory"
ATTRS{manufacturer}==" "
The specific USB thumb drive in this example doesn't have a vendor string. However, this is not the case for all devices. For example, my mobile phone connected as a USB device reports the following:
ATTRS{manufacturer}=="SAMSUNG "
ATTRS{product}=="SGH-I897 "
Once you have the required information, you can create a rule in the /etc/udev/rules.d/ directory:
sudo vi /etc/udev/rules.d/95-usbtrigger.rules
Refer to the README file in that directory on how to name rule files.
Here is an example of a simple rule. This is just an example. The model, vendor and name of the script to run will be different depending on hardware and script to be run. You could even exclude some of the attributes if you want to have the script triggered for any USB device:
ACTION=="add", SUBSYSTEM=="usb", ATTRS{product}=="USB Flash Memory",ATTRS{manufacturer}==" ", RUN+="/usr/local/bin/usbtrigger.sh"
The script usbtrigger.sh, is just a simple script that creates a file:
#!/bin/bash
date=`date +%m%d%Y-%k%M%S`
echo 'udev script triggered' > /tmp/usb_trigger_testfile.$date
In this simple example, the script /usr/local/bin/usbtrigger.sh will be run when a USB device with the matching "product" and "manufacturer" is inserted. The usbtrigger.sh script can be replaced with a script to perform the desired functionality.
Saturday, February 19, 2011
multipath I/O
Multipath is used to detect multiple paths to devices for fail-over or performance reasons. The multipathd daemon is in charge of checking for failed paths. When a path fails, multipathd will reconfigure the multipath map for that path. The multipathd daemon executes the external multipath tool when failures occur. When a failure occurs, the multipath tool signals the multipathd daemon once the device map reconfiguration is complete. This article will show you the basic steps to get multipath working. There are many tuning and configuration parameters for multipath. However, those options are out of the scope of this document.
What you need...For Ubuntu anyways...
# Ensure you are using supported hardware. See "External Links" section for a link to the supported hardware page.
# Install the multipath-tools package.
If performing a "Boot from SAN", the multipath-tools-boot package also needs to be installed.
# Create a valid multipath.conf file.
Setup
Install the multipath package
$ sudo apt-get install multipath-tools
If booting from a SAN device, also install multipath-tools-boot:
$ sudo apt-get install multipath-tools-boot
Create a valid multipath.conf file for your environement
Take a look at the examples in /usr/share/doc/multipath-tools/examples. Although multipath does work without a multipath.conf configuration file, you will only be able access your storage device(LUNs/Volumes) by their WWID. It is reccomended to use a multipath.conf file to at least be able to blacklist devices and assign **friendly** aliases for device names. This allows a greater ease of administration.
To create a multipath.conf file, you first need to identify the WWIDs for your LUNS/Volumes. This is done with the multipath command. Note the option **-v2** this can be changed to increase the output verbosity, such as **v3**, **v4**, ect. The WWID for each volume is the first column on the first and seventh line(Note, this shows two LUNS/Volumes). In this example, the WWIDs are: **320000004cfb59a33** and **320000004cfacaaee**. Later in this article, you will see this output again for these two WWIDs, but the output will also report the alias names that are configured.
$ sudo multipath -v2 -ll
320000004cfb59a33 dm-4 COMPAQ ,BD03654499
[size=34G][features=0][hwhandler=0]
\_ round-robin 0 [prio=1][active]
\_ 4:0:0:0 sdl 8:176 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 2:0:0:0 sda 8:0 [active][ready]
320000004cfacaaee dm-8 COMPAQ ,BD03654499
[size=34G][features=0][hwhandler=0]
\_ round-robin 0 [prio=1][active]
\_ 4:0:1:0 sdm 8:192 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 2:0:1:0 sdb 8:16 [active][ready]
You want to copy the WWIDs to enter them into the multipath.conf file.
Example multipath.conf file(See /usr/share/doc/multipath-tools/examples/multipath.conf.annotated for full details):
blacklist {
devnode "^sda$"
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^cciss!c[0-9]d[0-9]*"
}
defaults {
udev_dir /dev
polling_interval 10
selector "round-robin 0"
path_grouping_policy multibus
getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
prio_callout /bin/true
path_checker readsector0
rr_min_io 100
max_fds 8192
rr_weight priorities
failback immediate
no_path_retry fail
user_friendly_names yes
}
multipaths {
multipath {
wwid 320000004cfb59a33
alias volume-alias1
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
multipath {
wwid 320000004cfacaaee
alias volume-alias2
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
}
devices {
device {
vendor "(COMPAQ|HP)"
product "HSV1[01]1|HSV2[01]0|HSV300"
getuid_callout "/sbin/scsi_id -g -u -s /dev/%n"
prio_callout "/sbin/mpath_prio_alua /dev/%n"
features "0"
hardware_handler "0"
path_selector "round-robin 0"
path_grouping_policy group_by_prio
failback immediate
rr_weight uniform
no_path_retry 12
rr_min_io 100
path_checker tur
}
}
=Breakdown of multipath.conf file example=
**devnode_blacklist**
This section lists devices to be excluded by multipath (with regex matching). It is a good idea to blacklist the local/internal disks and any other devices to not be used by multipath.
blacklist {
devnode "^sda$"
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^cciss!c[0-9]d[0-9]*"
}
**multipaths**
This is were you map LUNS/Volumes to a friendly alias. You will have multiple multipath stanzas for every LUN/Volume used on your storage array.
multipaths {
multipath {
wwid YOUR_FIRST_WWID_HERE
alias VOL1
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
multipath {
wwid YOUR_SECOND_WWID_HERE
alias VOL2
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
}
**devices**
This is where you provide the model specific information for your storage array. The details for the device are usually provided by the manufacturer with reccomended values for each parameter. This following provides examples for EMC, HP and Equallogic arrays. These examples are to illustrate the how each type of device can differ.
devices {
device {
vendor "EMC "
product "SYMMETRIX"
path_grouping_policy multibus
getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
path_selector "round-robin 0"
features "0"
hardware_handler "0"
failback immediate
}
device {
vendor "COMPAQ"
product "HSV110 (C)COMPAQ"
path_grouping_policy multibus
getuid_callout "/sbin/scsi_id -g -u -s /dev/%n"
path_checker readsector0
path_selector "round-robin 0"
hardware_handler "0"
failback 15
rr_weight priorities
no_path_retry queue
}
device {
vendor "COMPAQ"
product "MSA1000"
path_grouping_policy multibus
}
device {
vendor "(COMPAQ|HP)"
product "HSV1[01]1|HSV2[01]0|HSV300"
getuid_callout "/sbin/scsi_id -g -u -s /dev/%n"
prio_callout "/sbin/mpath_prio_alua /dev/%n"
features "0"
hardware_handler "0"
path_selector "round-robin 0"
path_grouping_policy group_by_prio
failback immediate
rr_weight uniform
no_path_retry 12
rr_min_io 100
path_checker tur
}
device {
vendor "EQLOGIC"
product "100E-00"
path_grouping_policy multibus
getuid_callout "/sbin/scsi_id -g -u -s /dev/%n"
features "1 queue_if_no_path"
path_checker readsector0
failback immediate
path_selector "round-robin 0"
rr_min_io 10
rr_weight priorities
}
}
Once the multipath.conf file is created, you need to copy it to the /etc directory. The multipath-tools daemon then needs to be restarted.
sudo /etc/init.d/multipath-tools restart
You can then re-issue the multipath -v2 -ll command and notice the output now contins the alias name you created in the multipath.conf file, followed by the wwid in parentheses. Also notice you can see two paths for each LUN/Volume. Depending on your environment, you may have more than two paths.
sudo multipath -v2 -ll
volume-alias1 (320000004cfb59a33) dm-4 COMPAQ ,BD03654499
[size=34G][features=1 queue_if_no_path][hwhandler=0]
\_ round-robin 0 [prio=0][active]
\_ 4:0:0:0 sdl 8:176 [active][ready]
\_ 2:0:0:0 sda 8:0 [active][ready]
volume-alias2 (320000004cfacaaee) dm-8 COMPAQ ,BD03654499
[size=34G][features=1 queue_if_no_path][hwhandler=0]
\_ round-robin 0 [prio=0][active]
\_ 4:0:1:0 sdm 8:192 [active][ready]
\_ 2:0:1:0 sdb 8:16 [active][ready]
= Accessing Your LUNS/Volumes =
Your LUNS/Volumes will now be accessable under /dev/mapper/YOUR_ALIAS_NAME. You can treat this device like a reagular block device. You can partition it, and create a filesystem on it. However, "Under the covers" you can loose a path or have the real block device name change, you your applicaiton will not be affected. Here is what the /dev/mapper directory looks like from the previous examples:
$ ls -l /dev/mapper/
lrwxrwxrwx 1 root root 7 2011-02-18 15:35 volume-alias1 -> ../dm-4
lrwxrwxrwx 1 root root 7 2011-02-18 15:35 volume-alias2 -> ../dm-8
Example of partitioning this new device:
sudo fdisk /dev/mapper/volume-alias
$ sudo fdisk /dev/mapper/volume-alias1
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-4427, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-4427, default 4427):
Using default value 4427
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Review the contents of /dev/mapper after partitioning the device(Notice there is now volume-alias1-part1):
$ ls -l /dev/mapper/
lrwxrwxrwx 1 root root 7 2011-02-18 16:08 volume-alias1 -> ../dm-4
lrwxrwxrwx 1 root root 8 2011-02-18 16:08 volume-alias1-part1 -> ../dm-16
lrwxrwxrwx 1 root root 7 2011-02-18 15:35 volume-alias2 -> ../dm-8
Example of creating a filesystem on the newly partitioned device:
sudo mkfs -t ext4 /dev/mapper/volume-alias1-part1
Now the filesytem can be mounted(Assumes /mnt/volume-alias1-part1-mountpoint exists):
sudo mount /dev/mapper/volume-alias1-part1 /mnt/volume-alias1-part1-mountpoint
$ df /mnt/volume-alias1-part1-mountpoint/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/volume-alias1-part1
35001508 180104 33043412 1% /mnt/volume-alias1-part1-mountpoint
= Useful Tools =
In the case you add a new storage array(s) to your system, there is a useful tool that can be used to perform a rescan of FibreChannel devices. This tool is a shell script named rescan-scsi-bus.sh. To obtain this script, you need to install the scsitools package. The package can be installed by running the following:
sudo apt-get install scsitools
The rescan-scsi-bus.sh script is now install and can be run as the following:
sudo rescan-scsi-bus.sh
This script basically performs tasks similar to a FibreChannel LIP reset.
For iSCSI device, the iscsiadm tool is used. The full details of iscsiadm is not covered in this article. However, see the "External Links" section for iSCSI man page..
= External Links =
* Multipathd man page: http://manpages.ubuntu.com/manpages/lucid/man8/multipathd.8.html
* Multipath man page: http://manpages.ubuntu.com/manpages/lucid/man8/multipath.8.html
* Multipath.conf man page: http://manpages.ubuntu.com/manpages/lucid/man5/multipath.conf.5.html
* Hardware Support: https://wiki.ubuntu.com/HardwareSupport
* Component Support: http://www.ubuntu.com/certification/catalog
* rescan-scsi-bus.sh man page: http://manpages.ubuntu.com/manpages/lucid/man8/rescan-scsi-bus.sh.8.html
* iscsiadm man page: http://manpages.ubuntu.com/manpages/lucid/man8/iscsiadm.8.html
What you need...For Ubuntu anyways...
# Ensure you are using supported hardware. See "External Links" section for a link to the supported hardware page.
# Install the multipath-tools package.
If performing a "Boot from SAN", the multipath-tools-boot package also needs to be installed.
# Create a valid multipath.conf file.
Setup
Install the multipath package
$ sudo apt-get install multipath-tools
If booting from a SAN device, also install multipath-tools-boot:
$ sudo apt-get install multipath-tools-boot
Create a valid multipath.conf file for your environement
Take a look at the examples in /usr/share/doc/multipath-tools/examples. Although multipath does work without a multipath.conf configuration file, you will only be able access your storage device(LUNs/Volumes) by their WWID. It is reccomended to use a multipath.conf file to at least be able to blacklist devices and assign **friendly** aliases for device names. This allows a greater ease of administration.
To create a multipath.conf file, you first need to identify the WWIDs for your LUNS/Volumes. This is done with the multipath command. Note the option **-v2** this can be changed to increase the output verbosity, such as **v3**, **v4**, ect. The WWID for each volume is the first column on the first and seventh line(Note, this shows two LUNS/Volumes). In this example, the WWIDs are: **320000004cfb59a33** and **320000004cfacaaee**. Later in this article, you will see this output again for these two WWIDs, but the output will also report the alias names that are configured.
$ sudo multipath -v2 -ll
320000004cfb59a33 dm-4 COMPAQ ,BD03654499
[size=34G][features=0][hwhandler=0]
\_ round-robin 0 [prio=1][active]
\_ 4:0:0:0 sdl 8:176 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 2:0:0:0 sda 8:0 [active][ready]
320000004cfacaaee dm-8 COMPAQ ,BD03654499
[size=34G][features=0][hwhandler=0]
\_ round-robin 0 [prio=1][active]
\_ 4:0:1:0 sdm 8:192 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 2:0:1:0 sdb 8:16 [active][ready]
You want to copy the WWIDs to enter them into the multipath.conf file.
Example multipath.conf file(See /usr/share/doc/multipath-tools/examples/multipath.conf.annotated for full details):
blacklist {
devnode "^sda$"
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^cciss!c[0-9]d[0-9]*"
}
defaults {
udev_dir /dev
polling_interval 10
selector "round-robin 0"
path_grouping_policy multibus
getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
prio_callout /bin/true
path_checker readsector0
rr_min_io 100
max_fds 8192
rr_weight priorities
failback immediate
no_path_retry fail
user_friendly_names yes
}
multipaths {
multipath {
wwid 320000004cfb59a33
alias volume-alias1
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
multipath {
wwid 320000004cfacaaee
alias volume-alias2
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
}
devices {
device {
vendor "(COMPAQ|HP)"
product "HSV1[01]1|HSV2[01]0|HSV300"
getuid_callout "/sbin/scsi_id -g -u -s /dev/%n"
prio_callout "/sbin/mpath_prio_alua /dev/%n"
features "0"
hardware_handler "0"
path_selector "round-robin 0"
path_grouping_policy group_by_prio
failback immediate
rr_weight uniform
no_path_retry 12
rr_min_io 100
path_checker tur
}
}
=Breakdown of multipath.conf file example=
**devnode_blacklist**
This section lists devices to be excluded by multipath (with regex matching). It is a good idea to blacklist the local/internal disks and any other devices to not be used by multipath.
blacklist {
devnode "^sda$"
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
devnode "^cciss!c[0-9]d[0-9]*"
}
**multipaths**
This is were you map LUNS/Volumes to a friendly alias. You will have multiple multipath stanzas for every LUN/Volume used on your storage array.
multipaths {
multipath {
wwid YOUR_FIRST_WWID_HERE
alias VOL1
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
multipath {
wwid YOUR_SECOND_WWID_HERE
alias VOL2
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
failback manual
rr_weight priorities
no_path_retry 5
}
}
**devices**
This is where you provide the model specific information for your storage array. The details for the device are usually provided by the manufacturer with reccomended values for each parameter. This following provides examples for EMC, HP and Equallogic arrays. These examples are to illustrate the how each type of device can differ.
devices {
device {
vendor "EMC "
product "SYMMETRIX"
path_grouping_policy multibus
getuid_callout "/lib/udev/scsi_id -g -u -d /dev/%n"
path_selector "round-robin 0"
features "0"
hardware_handler "0"
failback immediate
}
device {
vendor "COMPAQ"
product "HSV110 (C)COMPAQ"
path_grouping_policy multibus
getuid_callout "/sbin/scsi_id -g -u -s /dev/%n"
path_checker readsector0
path_selector "round-robin 0"
hardware_handler "0"
failback 15
rr_weight priorities
no_path_retry queue
}
device {
vendor "COMPAQ"
product "MSA1000"
path_grouping_policy multibus
}
device {
vendor "(COMPAQ|HP)"
product "HSV1[01]1|HSV2[01]0|HSV300"
getuid_callout "/sbin/scsi_id -g -u -s /dev/%n"
prio_callout "/sbin/mpath_prio_alua /dev/%n"
features "0"
hardware_handler "0"
path_selector "round-robin 0"
path_grouping_policy group_by_prio
failback immediate
rr_weight uniform
no_path_retry 12
rr_min_io 100
path_checker tur
}
device {
vendor "EQLOGIC"
product "100E-00"
path_grouping_policy multibus
getuid_callout "/sbin/scsi_id -g -u -s /dev/%n"
features "1 queue_if_no_path"
path_checker readsector0
failback immediate
path_selector "round-robin 0"
rr_min_io 10
rr_weight priorities
}
}
Once the multipath.conf file is created, you need to copy it to the /etc directory. The multipath-tools daemon then needs to be restarted.
sudo /etc/init.d/multipath-tools restart
You can then re-issue the multipath -v2 -ll command and notice the output now contins the alias name you created in the multipath.conf file, followed by the wwid in parentheses. Also notice you can see two paths for each LUN/Volume. Depending on your environment, you may have more than two paths.
sudo multipath -v2 -ll
volume-alias1 (320000004cfb59a33) dm-4 COMPAQ ,BD03654499
[size=34G][features=1 queue_if_no_path][hwhandler=0]
\_ round-robin 0 [prio=0][active]
\_ 4:0:0:0 sdl 8:176 [active][ready]
\_ 2:0:0:0 sda 8:0 [active][ready]
volume-alias2 (320000004cfacaaee) dm-8 COMPAQ ,BD03654499
[size=34G][features=1 queue_if_no_path][hwhandler=0]
\_ round-robin 0 [prio=0][active]
\_ 4:0:1:0 sdm 8:192 [active][ready]
\_ 2:0:1:0 sdb 8:16 [active][ready]
= Accessing Your LUNS/Volumes =
Your LUNS/Volumes will now be accessable under /dev/mapper/YOUR_ALIAS_NAME. You can treat this device like a reagular block device. You can partition it, and create a filesystem on it. However, "Under the covers" you can loose a path or have the real block device name change, you your applicaiton will not be affected. Here is what the /dev/mapper directory looks like from the previous examples:
$ ls -l /dev/mapper/
lrwxrwxrwx 1 root root 7 2011-02-18 15:35 volume-alias1 -> ../dm-4
lrwxrwxrwx 1 root root 7 2011-02-18 15:35 volume-alias2 -> ../dm-8
Example of partitioning this new device:
sudo fdisk /dev/mapper/volume-alias
$ sudo fdisk /dev/mapper/volume-alias1
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-4427, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-4427, default 4427):
Using default value 4427
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Review the contents of /dev/mapper after partitioning the device(Notice there is now volume-alias1-part1):
$ ls -l /dev/mapper/
lrwxrwxrwx 1 root root 7 2011-02-18 16:08 volume-alias1 -> ../dm-4
lrwxrwxrwx 1 root root 8 2011-02-18 16:08 volume-alias1-part1 -> ../dm-16
lrwxrwxrwx 1 root root 7 2011-02-18 15:35 volume-alias2 -> ../dm-8
Example of creating a filesystem on the newly partitioned device:
sudo mkfs -t ext4 /dev/mapper/volume-alias1-part1
Now the filesytem can be mounted(Assumes /mnt/volume-alias1-part1-mountpoint exists):
sudo mount /dev/mapper/volume-alias1-part1 /mnt/volume-alias1-part1-mountpoint
$ df /mnt/volume-alias1-part1-mountpoint/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/volume-alias1-part1
35001508 180104 33043412 1% /mnt/volume-alias1-part1-mountpoint
= Useful Tools =
In the case you add a new storage array(s) to your system, there is a useful tool that can be used to perform a rescan of FibreChannel devices. This tool is a shell script named rescan-scsi-bus.sh. To obtain this script, you need to install the scsitools package. The package can be installed by running the following:
sudo apt-get install scsitools
The rescan-scsi-bus.sh script is now install and can be run as the following:
sudo rescan-scsi-bus.sh
This script basically performs tasks similar to a FibreChannel LIP reset.
For iSCSI device, the iscsiadm tool is used. The full details of iscsiadm is not covered in this article. However, see the "External Links" section for iSCSI man page..
= External Links =
* Multipathd man page: http://manpages.ubuntu.com/manpages/lucid/man8/multipathd.8.html
* Multipath man page: http://manpages.ubuntu.com/manpages/lucid/man8/multipath.8.html
* Multipath.conf man page: http://manpages.ubuntu.com/manpages/lucid/man5/multipath.conf.5.html
* Hardware Support: https://wiki.ubuntu.com/HardwareSupport
* Component Support: http://www.ubuntu.com/certification/catalog
* rescan-scsi-bus.sh man page: http://manpages.ubuntu.com/manpages/lucid/man8/rescan-scsi-bus.sh.8.html
* iscsiadm man page: http://manpages.ubuntu.com/manpages/lucid/man8/iscsiadm.8.html
Subscribe to:
Posts (Atom)