-
Notifications
You must be signed in to change notification settings - Fork 9
Créer,supprimer un filesystem
PhilippeLeroux edited this page Jul 3, 2017
·
5 revisions
Création d'un FS nommé /u10
-
Se connecter
root
sur le serveur :ssh root@srvdaisy02
-
Créer les LUNs sur K2 :
$ ssh K2 'plescripts/san/add_and_export_lv.sh -export_to="srvdaisy02" -vg_name=asm01 -count=4' $ iscsiadm -m node --rescan
Les disques peuvent être créer sur VBox, mais il faut stopper la VM.
Le script
virtualbox/add_disk.sh
permet de le faire, ou bien utiliser l'interface graphique. -
Le script
create_fs.sh
se charge de créer le LV et le FS sur le ou les disques disponibles. L'option-netdev
n'est pas utile si le disque est géré par VBox.[root@srvdaisy02 disk]# ./create_fs.sh -mount_point=/u10 -suffix_vglv=grid2 -type_fs=xfs -disks=4 -noatime -netdev # Search 4 disks unused : # Device found 4 : /dev/sdo /dev/sdp /dev/sdq /dev/sdr # Create fs xfs on devices /dev/sdo /dev/sdp /dev/sdq /dev/sdr : mount point /u10 # add partition to /dev/sdo 11h19> fdisk /dev/sdo n p 1 Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x15c94bd9. 11h19> pvcreate -y /dev/sdo1 Physical volume "/dev/sdo1" successfully created. # add partition to /dev/sdp 11h19> fdisk /dev/sdp n p 1 Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0xafccd9c0. 11h19> pvcreate -y /dev/sdp1 Physical volume "/dev/sdp1" successfully created. # add partition to /dev/sdq 11h19> fdisk /dev/sdq n p 1 Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x5b3e4075. 11h19> pvcreate -y /dev/sdq1 Physical volume "/dev/sdq1" successfully created. # add partition to /dev/sdr 11h19> fdisk /dev/sdr n p 1 Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x8c0eece2. 11h19> pvcreate -y /dev/sdr1 Physical volume "/dev/sdr1" successfully created. 11h19> vgcreate vggrid2 /dev/sdo1 /dev/sdp1 /dev/sdq1 /dev/sdr1 Volume group "vggrid2" successfully created # Create linear FS 11h19> lvcreate -y -l 100%FREE -n lvgrid2 vggrid2 Logical volume "lvgrid2" created. 11h19> mkfs -t xfs /dev/vggrid2/lvgrid2 meta-data=/dev/vggrid2/lvgrid2 isize=256 agcount=4, agsize=1046528 blks = sectsz=512 attr=2, projid32bit=1 = crc=0 finobt=0, sparse=0 data = bsize=4096 blocks=4186112, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=0 log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 11h19> mkdir -p /u10 11h19> echo "/dev/mapper/vggrid2-lvgrid2 /u10 xfs _netdev,noatime,defaults 0 0" >> /etc/fstab 11h19> mount /u10
-
Le script
plescripts/disk/drop_fs.sh
prend en charge le démontage, la suppression du LV et le nettoyage des disques.Exemple :
cd disk && ./drop_fs.sh -fs=/u10