środa, 23 września 2015

ADD and DEL disc linux no reboot

Sprawdzamy

dmesg | grep sdb

# partx -l /dev/sdb 

# partx -v -a /dev/sdb  

/dev/mapper# vgscan --mknodes

  lvscan -l

 

Step # 2: Rescan the SCSI Bus to Add a SCSI Device Without rebooting the VM

A rescan can be issued by typing the following command:
 
"""W jednej lini 
ls /sys/class/scsi_host/ | while read host ; 
do echo "- - -" > /sys/class/scsi_host/$host/scan ; done

"""

fdisk -l
tail -f /var/log/message





=====================================================



How Do I Delete a Single Device Called /dev/sdc?

In addition to re-scanning the entire bus, a specific device can be added or existing device deleted using the following command:
# echo 1 > /sys/block/devName/device/delete
# echo 1 > /sys/block/sdc/device/delete

How Do I Add a Single Device Called /dev/sdc?

To add a single device explicitly, use the following syntax:
# echo "scsi add-single-device    " > /proc/scsi/scsi
Where,
  • : Host
  • : Bus (Channel)
  • : Target (Id)
  • : LUN numbers
For e.g. add /dev/sdc with host # 0, bus # 0, target # 2, and LUN # 0, enter:
# echo "scsi add-single-device 0 0 2 0">/proc/scsi/scsi
# fdisk -l
# cat /proc/scsi/scsi




=========================================================

Step #3: Format a New Disk

Now, you can create partition using fdisk and format it using mkfs.ext3 command:
# fdisk /dev/sdc
# mkfs.ext3 /dev/sdc3

Step #4: Create a Mount Point And Update /etc/fstab

# mkdir /disk3
Open /etc/fstab file, enter:
# vi /etc/fstab
Append as follows:
/dev/sdc3               /disk3           ext3    defaults        1 2

Brak komentarzy:

Prześlij komentarz