忍者ブログ
  • 2024.03«
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • » 2024.05
[PR]
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

【2024/04/19 09:20 】 |
LVMを試してみる
もうパーティションの開始アドレスとかを気にしなくても良くなるLVMを試してみた。

LVMは物理ボリュームをグローバルボリュームとしてまとめ、論理ボリュームとして切り出して使うイメージだ。
これの使い道はkvmのディスク等いろいろ使えそう
PV(=物理ボリューム) ⊆ GV(=グローバルボリューム) ⊇ LV(論理ボリューム)
(1)物理ボリュームを作成
※lvmに使うパーティションはpartedでset n lvm onをしておく。
# pvcreate /dev/sda1
(2)ボリュームグループを作成
# vgcreate VG_SDA /dev/sda1
(3)論理ボリュームを作成
# lvcreate -L 40G -n home.cur VG_SDA
確認例
# vgdisplay -v
  --- Volume group ---
  VG Name               VG_SDA
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               <1.82 TiB
  PE Size               4.00 MiB
  Total PE              476932
  Alloc PE / Size       111216 / <434.44 GiB
  Free  PE / Size       365716 / <1.40 TiB
  VG UUID               GKpSTs-Mwtn-KBYo-ieDQ-XhFa-3ZVh-oY8x5G
   
  --- Logical volume ---
  LV Path                /dev/VG_SDA/home.cur
  LV Name                home.cur
  VG Name                VG_SDA
  LV UUID                MRDH1I-KKj7-YcVO-ztDI-bfcO-I8yz-eh6GOv
  LV Write Access        read/write
  LV Creation host, time pc001, 2018-12-02 19:06:34 +0900
  LV Status              available
  # open                 1
  LV Size                40.00 GiB
  Current LE             10240
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
   
  --- Logical volume ---
  LV Path                /dev/VG_SDA/win10.img
  LV Name                win10.img
  VG Name                VG_SDA
  LV UUID                EEdeJ1-SZWa-YaqP-SJLK-vd4n-wVjh-ASrj85
  LV Write Access        read/write
  LV Creation host, time pc001, 2018-12-08 08:10:55 +0900
  LV Status              available
  # open                 0
  LV Size                <94.44 GiB
  Current LE             24176
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
   
  --- Logical volume ---
  LV Path                /dev/VG_SDA/work
  LV Name                work
  VG Name                VG_SDA
  LV UUID                Z3vbrP-G9sc-7OLk-oTsV-CheY-Wy45-QT6z1b
  LV Write Access        read/write
  LV Creation host, time pc001, 2018-12-08 08:13:21 +0900
  LV Status              available
  # open                 1
  LV Size                200.00 GiB
  Current LE             51200
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2
   
  --- Logical volume ---
  LV Path                /dev/VG_SDA/win_work.img
  LV Name                win_work.img
  VG Name                VG_SDA
  LV UUID                5AC5rm-eo20-jNL3-b9XH-BfFe-yusp-adobt8
  LV Write Access        read/write
  LV Creation host, time pc001, 2018-12-08 10:43:29 +0900
  LV Status              available
  # open                 1
  LV Size                100.00 GiB
  Current LE             25600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3
   
  --- Physical volumes ---
  PV Name               /dev/sda1     
  PV UUID               4QkoE0-5YNL-LOi7-qwci-jJE6-yAvh-8fnv0Q
  PV Status             allocatable
  Total PE / Free PE    476932 / 365716
   

拍手[0回]

PR
【2018/12/08 12:16 】 | linux | 有り難いご意見(0)
期待できないExpect
Expectを使えるか試してみようと「sed」と対話するスクリプトを作った結果・・・
●スクリプト
#!/bin/expect -f
 
spawn sed -e "s/Q/A/g"
set timeout 1
 
send -raw "Q\n"
expect {
        -re "A" {puts "OK!"}
}

send -raw "Q\n"
expect {
        -re "Q" {puts "No Change!"}
}
 
send -raw "Q\n"
expect {
        -re "B" {puts "Wrong!"}
}
 
close
 
exit
●結果
spawn sed -e s/Q/A/g
Q
A
OK!
Q
No Change!
A
Q
A
なぜに、sendした文字も拾ってるんだーーーー。orz

拍手[0回]

【2015/05/05 16:49 】 | linux | 有り難いご意見(2)
How to use Wireless Network With WLI-UC-GNM2 [RT3070]&HostAP 802.11n&WPA2RSK
I'm very tired looking for this process.
I'll write this article for anyone who need this info.

(1)Insall hostapd.

(2)copy your working directory. and edit.

(a) cp /usr/share/doc/hostapd-2.0/hostapd.conf .

(b)Editing Point of hostapd.conf is that I explain with patch.


@@ -16,13 +16,13 @@
# added to the bridge automatically (brctl may refuse to do this before hostapd
# has been started to change the interface mode). If needed, the bridge
# interface is also created.
-#bridge=br0
+bridge=br0 #create gateway of AP. Concrete doing is follow .

# Driver interface type (hostap/wired/madwifi/test/none/nl80211/bsd);
# default: hostap). nl80211 is used with all Linux mac80211 drivers.
# Use driver=none if building hostapd as a standalone RADIUS server that does
# not control any wireless/wired driver.
-# driver=hostap
+driver=nl80211 #If your driver isn't hardAP, select nl80211

# hostapd event logger configuration
#
@@ -83,31 +83,21 @@
##### IEEE 802.11 related configuration #######################################

# SSID to be used in IEEE 802.11 management frames
-ssid=test
-# Alternative formats for configuring SSID
-# (double quoted string, hexdump, printf-escaped string)
-#ssid2="test"
-#ssid2=74657374
-#ssid2=P"hello\nthere"
-
-# UTF-8 SSID: Whether the SSID is to be interpreted using UTF-8 encoding
-#utf8_ssid=1
+ssid=SSID_NAME #Name you like one.

# Country code (ISO/IEC 3166-1). Used to set regulatory domain.
# Set as needed to indicate country in which device is operating.
# This can limit available channels and transmit power.
-#country_code=US
+country_code=JP #Select your country

# Enable IEEE 802.11d. This advertises the country_code and the set of allowed
# channels and transmit power levels based on the regulatory limits. The
# country_code setting must be configured with the correct country for
# IEEE 802.11d functions.
# (default: 0 = disabled)
-#ieee80211d=1
+ieee80211d=1 #It maybe check your law wireless restriction.

# Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g,
-# ad = IEEE 802.11ad (60 GHz); a/g options are used with IEEE 802.11n, too, to
-# specify band)
# Default: IEEE 802.11b
hw_mode=g #To use with 802.11n, select 'g'.
@@ -194,7 +184,7 @@
# Bit fields of allowed authentication algorithms:
# bit 0 = Open System Authentication
# bit 1 = Shared Key Authentication (requires WEP)
-auth_algs=3
+auth_algs=1 #I don't use WEP, So I changed 3 to 1.

# Send empty SSID in beacons and ignore probe request frames that do not
# specify full SSID, i.e., require stations to know SSID.
@@ -393,7 +370,7 @@
# 0 = disabled (default)
# 1 = enabled
# Note: You will also need to enable WMM for full HT functionality.
-#ieee80211n=1
+ieee80211n=1 #This let you happy. I tried and see changing 54Mbps to 65Mbps. I'm very happy

# ht_capab: HT capabilities (list of flags)
# LDPC coding capability: [LDPC] = supported
@@ -428,161 +405,10 @@
# DSSS/CCK Mode in 40 MHz: [DSSS_CCK-40] = allowed (not allowed if not set)
# PSMP support: [PSMP] (disabled if not set)
# L-SIG TXOP protection support: [LSIG-TXOP-PROT] (disabled if not set)
-#ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]
+ht_capab=[HT+][SHORT-GI-40] #I select feeling and seeing net infomation. Ahaha. Don't worry missing. Bad selection point is that program will tell you! Let's challenge.

# Require stations to support HT PHY (reject association if they do not)
-#require_ht=1
+require_ht=1 #Let's challenge!

##### IEEE 802.1X-2004 related configuration ##################################
@@ -923,7 +679,7 @@
# and/or WPA2 (full IEEE 802.11i/RSN):
# bit0 = WPA
# bit1 = IEEE 802.11i/RSN (WPA2) (dot11RSNAEnabled)
-#wpa=1
+wpa=2 #WPA2/RSK

# WPA pre-shared keys for WPA-PSK. This can be either entered as a 256-bit
# secret in hex format (64 hex digits), wpa_psk, or as an ASCII passphrase
@@ -931,8 +687,8 @@
# so the PSK changes when ASCII passphrase is used and the SSID is changed.
# wpa_psk (dot11RSNAConfigPSKValue)
# wpa_passphrase (dot11RSNAConfigPSKPassPhrase)
-#wpa_psk=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
-#wpa_passphrase=secret passphrase
+#wpa_psk=
+wpa_passphrase=YOUR_PASSWORD

# Optionally, WPA PSKs can be read from a separate text file (containing list
# of (PSK,MAC address) pairs. This allows more than one PSK to be configured.
@@ -940,20 +696,11 @@
# configuration reloads.
#wpa_psk_file=/etc/hostapd.wpa_psk

-# Optionally, WPA passphrase can be received from RADIUS authentication server
-# This requires macaddr_acl to be set to 2 (RADIUS)
-# 0 = disabled (default)
-# 1 = optional; use default passphrase/psk if RADIUS server does not include
-# Tunnel-Password
-# 2 = required; reject authentication if RADIUS server does not include
-# Tunnel-Password
-#wpa_psk_radius=0
-
# Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The
# entries are separated with a space. WPA-PSK-SHA256 and WPA-EAP-SHA256 can be
# added to enable SHA256-based stronger algorithms.
# (dot11RSNAConfigAuthenticationSuitesTable)
-#wpa_key_mgmt=WPA-PSK WPA-EAP
+wpa_key_mgmt=WPA-PSK #I deleted it. Because I don't use EAP.

# Set of accepted cipher suites (encryption algorithms) for pairwise keys
# (unicast packets). This is a space separated list of algorithms:
@@ -965,9 +712,9 @@
# TKIP will be used as the group cipher.
# (dot11RSNAConfigPairwiseCiphersTable)
# Pairwise cipher for WPA (v1) (default: TKIP)
-#wpa_pairwise=TKIP CCMP
+#wpa_pairwise=TKIP
# Pairwise cipher for RSN/WPA2 (default: use wpa_pairwise value)
-#rsn_pairwise=CCMP
+rsn_pairwise=CCMP TKIP #I use WPA2. so I comment out.

# Time interval for rekeying GTK (broadcast/multicast encryption keys) in
# seconds. (dot11RSNAConfigGroupRekeyTime)
@@ -1004,7 +751,7 @@
# allowed. This is only used with RSN/WPA2.
# 0 = disabled (default)
# 1 = enabled
-#peerkey=1
+peerkey=1 #I discover this point!!! But sometime no relation.. It works. Umm.

# ieee80211w: Whether management frame protection (MFP) is enabled
# 0 = disabled (default)



(3)exec "sudo hostapd hostapd.conf -d " and access from client machine.

[APPENDIX]
(a)You need driver rt2x00lib (rt2800usb,rt2800lib,rt2x00usb)
(b)Exec "rfkill list" and confirm the result.
6: phy5: Wireless LAN
Soft blocked: no
Hard blocked: no
(c)If Soft blocked is yes, Exec "sudo rfkill unblock wifi"
(d)If Hard blocked is yes, Exec "echo 1 | sudo tee /sys/class/rfkill/rfkill(any number)/state"


I'm happy for your help.

拍手[0回]

【2014/01/02 10:02 】 | linux | 有り難いご意見(0)
Debianインストール時の注意
(1)/bootをext4にすると、GRUBインストール時にファイルが見つからない言うて起こられる。
※手動インストールしようとしても、ファイル名が見えなかったりする。
 私は誤ってext4にしてしまったため、ファイルを退避、フォーマット、ファイル復元と面倒で悲しい結果に・・・。

(2)HDはvirtioではなくideつなぎにする。
ideじゃないと認識せずにNo bootable diskとか・・
※インストール時にはいけたみたいですが・・・

(3)後にWindowsを入れたければ、最初のプライマリパーティション分の領域を1G取っておく。
※4Gバイト以降にVistaを入れようとしても、システムないよって起こられて
 ntfs-g3でntfs作っても起こられて、結局Windowsインストーラで5番目のパーティションを削除・新規・フォーマットして入れようとしたら・・・、1個目のパーティションにシステムボリューム作ってもいい?ってきかれました・・。そんなんどこにものってないわ。

拍手[0回]

【2013/12/31 12:05 】 | linux | 有り難いご意見(0)
モニタなしPCへのDebianインストール
前にssh経由でLFSを構築したことがあってほおってたマシンを再利用できないかと考えて、
また作成することにした。
今回はVNC経由でソースからの構築ではなくディストリビューションDebianを入れることにする。

拍手[0回]

【2013/12/30 14:58 】 | linux | 有り難いご意見(0)
前ページ | ホーム | 次ページ

忍者ブログ [PR]