Linux2014. 12. 14. 21:52
일반적으로. 요즘 시스템은 EXT4를 많이 채용하지만
이녀석이 비록 SSD 대응하도록 만들어져 있긴 하지만 wear leveling 보다는 trim 지원 정도라고 해야하려나?
아무튼 wear leveling이 없다 보니 sd 메모리와 같은 MTD 장비에는 적합하지 않고
그로 인해 ext4를 쓰다 보면 파일 테이블에 손상을 입고 부팅이 불가능해질 가능성이 높다.

정식으로 MTD를 지원하는 파일 시스템은
JFFS / JFSS2 / YAFS / UBIFS 정도이고
EXT4는 MTD를 정식 지원하진 않는다.

임베디드 시스템에서의 커널변수 및 관련 자료
[링크 : http://free-electrons.com/blog/managing-flash-storage-with-linux/ ]

[링크 : http://en.wikipedia.org/wiki/Flash_file_system]
2010/11/21 - [개소리 왈왈/핸드폰(안드로이드)] - 갤럭시S 프로요, 그리고 부두
2012/04/04 - [Linux/Ubuntu] - 우분투 SSD 설정하기 

'Linux' 카테고리의 다른 글

dd / progress  (0) 2014.12.22
udev rule  (0) 2014.12.18
TTY / PTS 약자  (0) 2014.12.14
expect - shell script  (0) 2014.12.10
tty / pts redirect  (0) 2014.12.09
Posted by 구차니
Linux2014. 12. 14. 21:16
리눅스 장치명으로 콘솔은
/dev/tty(시리얼) 나 /dev/pts(ssh)로 대개 잡히는데
약자를 찾아보니..

Teletypewriter
Pseudo terminal slave

일려나?

[링크 : http://en.wikipedia.org/wiki/PTS]
[링크 : http://en.wikipedia.org/wiki/TTY

'Linux' 카테고리의 다른 글

udev rule  (0) 2014.12.18
플래시용 파일 시스템과 EXT4  (0) 2014.12.14
expect - shell script  (0) 2014.12.10
tty / pts redirect  (0) 2014.12.09
rootfs / 부트 속도 향상하기  (0) 2014.12.07
Posted by 구차니
Linux2014. 12. 10. 09:34
옆 사람에게 듣게 된 녀석인데..
과거(?) 이야기나 통신프로그램에서 자동응답 하듯
리눅스 쉘에 나오는 글씨에 대해서 반응하는 스크립트를 작성할수 있는 녀석

예를들어
expect로
login: 이라는 것과 password: 라는 것에
자동으로 아이디와 비밀번호를 넣어 줄수 있다고 한다!!!

[링크 : http://linux.die.net/man/1/expect]
[링크 : http://en.wikipedia.org/wiki/Expect]

[링크 : http://ktdsoss.tistory.com/151
[링크 : http://forum.falinux.com/zbxe/index.php?document_srl=791984&mid=lecture_tip

'Linux' 카테고리의 다른 글

플래시용 파일 시스템과 EXT4  (0) 2014.12.14
TTY / PTS 약자  (0) 2014.12.14
tty / pts redirect  (0) 2014.12.09
rootfs / 부트 속도 향상하기  (0) 2014.12.07
tar.gz 의 내용은 갱신이.. 안됨  (0) 2014.12.06
Posted by 구차니
Linux2014. 12. 9. 11:25
사용중인 콘솔이 강제 종료 되면서 붕 떠버린 작업이 되어버린 경우
이 작업을 다시 끌어 와야 할 필요가 있는데.. tty redirection을 통해
끊거나 끌어 올수가 있다고 한다.

screen 명령을 통하면
screen으로 떨어 낸것만 다시 데려 올수 있으나

tty redirection으로는 screen을 쓰지 않는 것 까지도 끌어 올수 있다고 하니
더 유용할 것 으로 생각된다.

되는지는 테스트 후 다시 수정..

[링크 : http://superuser.com/./redirect-input-from-one-terminal-to-another]
[링크 : http://stackoverflow.com/./redirect-the-stdin-to-come-from-a-different-terminal-using-bash]
[링크 : http://stackoverflow.com/./redirect-stderr-stdout-of-a-process-after-its-been-started-using-command-lin]

'Linux' 카테고리의 다른 글

TTY / PTS 약자  (0) 2014.12.14
expect - shell script  (0) 2014.12.10
rootfs / 부트 속도 향상하기  (0) 2014.12.07
tar.gz 의 내용은 갱신이.. 안됨  (0) 2014.12.06
tar 퍼미션 유지하기  (0) 2014.12.05
Posted by 구차니
Linux2014. 12. 7. 23:28
와.. 얼마나 갈아 넣어야 이렇게 최적화가 가능할까..
ㄷㄷㄷ

[링크 : http://elinux.org/images/2/2b/Elce11_hart.pdf]

'Linux' 카테고리의 다른 글

expect - shell script  (0) 2014.12.10
tty / pts redirect  (0) 2014.12.09
tar.gz 의 내용은 갱신이.. 안됨  (0) 2014.12.06
tar 퍼미션 유지하기  (0) 2014.12.05
압축풀지 않고 tar 파일 용량 알아내기  (0) 2014.12.02
Posted by 구차니
Linux/Ubuntu2014. 12. 7. 23:02
man 페이지의 저장 경로는..
한군데가 아니라 은근 여러군데 인 듯..

그래도 우분투 계열에서 주로 사용하는 경로는
/usr/share/man
/usr/local/man
/usr/local/share/man 
정도?

$ manpath
/usr/local/man:/usr/local/share/man:/usr/share/man 

$ cat /etc/manpath.config
# manpath.config
#
# This file is used by the man-db package to configure the man and cat paths.
# It is also used to provide a manpath for those without one by examining
# their PATH environment variable. For details see the manpath(5) man page.
#
# Lines beginning with `#' are comments and are ignored. Any combination of
# tabs or spaces may be used as `whitespace' separators.
#
# There are three mappings allowed in this file:
# --------------------------------------------------------
# MANDATORY_MANPATH                     manpath_element
# MANPATH_MAP           path_element    manpath_element
# MANDB_MAP             global_manpath  [relative_catpath]
#---------------------------------------------------------
# every automatically generated MANPATH includes these fields
#
#MANDATORY_MANPATH                      /usr/src/pvm3/man
#
MANDATORY_MANPATH                       /usr/man
MANDATORY_MANPATH                       /usr/share/man
MANDATORY_MANPATH                       /usr/local/share/man
#---------------------------------------------------------
# set up PATH to MANPATH mapping
# ie. what man tree holds man pages for what binary directory.
#
#               *PATH*        ->        *MANPATH*
#
MANPATH_MAP     /bin                    /usr/share/man
MANPATH_MAP     /usr/bin                /usr/share/man
MANPATH_MAP     /sbin                   /usr/share/man
MANPATH_MAP     /usr/sbin               /usr/share/man
MANPATH_MAP     /usr/local/bin          /usr/local/man
MANPATH_MAP     /usr/local/bin          /usr/local/share/man
MANPATH_MAP     /usr/local/sbin         /usr/local/man
MANPATH_MAP     /usr/local/sbin         /usr/local/share/man
MANPATH_MAP     /usr/X11R6/bin          /usr/X11R6/man
MANPATH_MAP     /usr/bin/X11            /usr/X11R6/man
MANPATH_MAP     /usr/games              /usr/share/man
MANPATH_MAP     /opt/bin                /opt/man
MANPATH_MAP     /opt/sbin               /opt/man
#---------------------------------------------------------
# For a manpath element to be treated as a system manpath (as most of those
# above should normally be), it must be mentioned below. Each line may have
# an optional extra string indicating the catpath associated with the
# manpath. If no catpath string is used, the catpath will default to the
# given manpath.
#
# You *must* provide all system manpaths, including manpaths for alternate
# operating systems, locale specific manpaths, and combinations of both, if
# they exist, otherwise the permissions of the user running man/mandb will
# be used to manipulate the manual pages. Also, mandb will not initialise
# the database cache for any manpaths not mentioned below unless explicitly
# requested to do so.
#
# In a per-user configuration file, this directive only controls the
# location of catpaths and the creation of database caches; it has no effect
# on privileges.
#
# Any manpaths that are subdirectories of other manpaths must be mentioned
# *before* the containing manpath. E.g. /usr/man/preformat must be listed
# before /usr/man.
#
#               *MANPATH*     ->        *CATPATH*
#
MANDB_MAP       /usr/man                /var/cache/man/fsstnd
MANDB_MAP       /usr/share/man          /var/cache/man
MANDB_MAP       /usr/local/man          /var/cache/man/oldlocal
MANDB_MAP       /usr/local/share/man    /var/cache/man/local
MANDB_MAP       /usr/X11R6/man          /var/cache/man/X11R6
MANDB_MAP       /opt/man                /var/cache/man/opt
#
#---------------------------------------------------------
# Program definitions.  These are commented out by default as the value
# of the definition is already the default.  To change: uncomment a
# definition and modify it.
#
#DEFINE         pager   pager -s
#DEFINE         cat     cat
#DEFINE         tr      tr '\255\267\264\327' '\055\157\047\170'
#DEFINE         grep    grep
#DEFINE         troff   groff -mandoc
#DEFINE         nroff   nroff -mandoc
#DEFINE         eqn     eqn
#DEFINE         neqn    neqn
#DEFINE         tbl     tbl
#DEFINE         col     col
#DEFINE         vgrind  vgrind
#DEFINE         refer   refer
#DEFINE         grap    grap
#DEFINE         pic     pic -S
#
#DEFINE         compressor      gzip -c7
#---------------------------------------------------------
# Misc definitions: same as program definitions above.
#
#DEFINE         whatis_grep_flags               -i
#DEFINE         apropos_grep_flags              -iEw
#DEFINE         apropos_regex_grep_flags        -iE
#---------------------------------------------------------
# Section names. Manual sections will be searched in the order listed here;
# the default is 1, n, l, 8, 3, 0, 2, 5, 4, 9, 6, 7. Multiple SECTION
# directives may be given for clarity, and will be concatenated together in
# the expected way.
# If a particular extension is not in this list (say, 1mh), it will be
# displayed with the rest of the section it belongs to. The effect of this
# is that you only need to explicitly list extensions if you want to force a
# particular order. Sections with extensions should usually be adjacent to
# their main section (e.g. "1 1mh 8 ...").
#
SECTION         1 n l 8 3 2 3posix 3pm 3perl 5 4 9 6 7
#
#---------------------------------------------------------
# Range of terminal widths permitted when displaying cat pages. If the
# terminal falls outside this range, cat pages will not be created (if
# missing) or displayed.
#
#MINCATWIDTH    80
#MAXCATWIDTH    80
#
# If CATWIDTH is set to a non-zero number, cat pages will always be
# formatted for a terminal of the given width, regardless of the width of
# the terminal actually being used. This should generally be within the
# range set by MINCATWIDTH and MAXCATWIDTH.
#
#CATWIDTH       0
#
#---------------------------------------------------------
# Flags.
# NOCACHE keeps man from creating cat pages.
#NOCACHE 

[링크 : http://gsp.com/cgi-bin/man.cgi?section=1&topic=manpath]
Posted by 구차니
Linux2014. 12. 6. 19:39
tar 면은 삭제 + 추가를 통해 갱신이 가능할지 모르겠지만
tar.gz 와 같이 압축된 tar 파일은 갱신이 불가능하다
$ tar --delete mpc8xx_irq.h -f test.tar.gz
tar: 압축된 아카이브를 갱신할 수 없습니다
tar: Error is not recoverable: exiting now 

CPU가 후달리는.. 임베디드에서는
새로 압축하기 무리일 수도 있으니.. 어찌 해결책이 없으려나.. -_ㅠ

[링크 : http://linux.die.net/man/1/tar]
[링크 : http://www.linuxquestions.org/questions/linux-general-1/update-tar-gz-file-564851/]
[링크 : http://unix.stackexchange.com/questions/13093/add-update-a-file-to-an-existing-tar-gz-archive]

'Linux' 카테고리의 다른 글

tty / pts redirect  (0) 2014.12.09
rootfs / 부트 속도 향상하기  (0) 2014.12.07
tar 퍼미션 유지하기  (0) 2014.12.05
압축풀지 않고 tar 파일 용량 알아내기  (0) 2014.12.02
mbr , fdisk, partprobe?  (0) 2014.12.02
Posted by 구차니
Linux2014. 12. 5. 16:15
busybox의 SUID가 풀려서 검색을 해보니 -_-

--no-same-permissions
apply the user's umask when extracting permissions from the archive (default for ordinary users)
 
-p, --preserve-permissions, --same-permissions
extract information about file permissions (default for superuser)
 
[링크 : http://linux.die.net/man/1/tar] 

근데 오락가락 하는거 보면.. 약간은 버그성일지도 모르겠다 ?

[링크 : http://seclists.org/bugtraq/2005/Aug/137]
[링크 : http://comments.gmane.org/gmane.linux.busybox/2683]
Posted by 구차니
Linux2014. 12. 2. 13:59
용량도 미묘하게 다르고..
시간 차이는 없는 것으로 보인다.

$ tar -tvzf rootfs.tar.gz |awk '{ s += $3 } END { print s }'
2014. 12. 02. (화) 13:59:54 KST
472650652
2014. 12. 02. (화) 14:00:06 KST 

$ zcat rootfs.tar.gz |wc -c
2014. 12. 02. (화) 14:00:12 KST
483491840
2014. 12. 02. (화) 14:00:23 KST 

[링크 : http://superuser.com/../find-out-the-size-of-a-tar-gz-archive-in-the-terminal-without-unpacking]
[링크 : http://serverfault.com/questions/9930/get-extracted-size-from-tgz-before-extracting

'Linux' 카테고리의 다른 글

tar.gz 의 내용은 갱신이.. 안됨  (0) 2014.12.06
tar 퍼미션 유지하기  (0) 2014.12.05
mbr , fdisk, partprobe?  (0) 2014.12.02
HPET - High Precision Event Timer / linux  (0) 2014.11.27
timezone  (0) 2014.11.21
Posted by 구차니
Linux2014. 12. 2. 08:52
강제로 mbr을 갈아 엎으면
fdisk로 들어가서 정보가 보이는데
w를 해서 저장을 하지 않고  q로 나오면은 
커널에서도 변경된 파티션으로 인식하지 못하는 문제가 있다.

이를 해결하기 위해서는 멀 해야 하려나 -_- 

minimonk@devmini:~/nfs/Ver1.0.1.12$ sudo fdisk /dev/sdb

Command (m for help): d
Partition number (1-4): 1

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Selected partition 3

Command (m for help): p

Disk /dev/sdb: 1977 MB, 1977614336 bytes
61 heads, 62 sectors/track, 1021 cylinders, total 3862528 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: 0x37168ace

   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. 

minimonk@devmini:~/nfs/Ver1.0.1.12$  sudo dd if=./mbr.imx283 of=/dev/sdb
1+0 레코드 들어옴
1+0 레코드 나감
512 바이트 (512 B) 복사됨, 0.00272973 초, 188 kB/초 

minimonk@devmini:~/nfs/Ver1.0.1.12$ dmesg | tail
[420014.024095] sd 38:0:0:0: [sdb] No Caching mode page found
[420014.024112] sd 38:0:0:0: [sdb] Assuming drive cache: write through
[420014.026165]  sdb: 

minimonk@devmini:~/nfs/Ver1.0.1.12$ sudo fdisk /dev/sdb

Command (m for help): q

minimonk@devmini:~/nfs/Ver1.0.1.12$ dmesg | tail
[420014.024095] sd 38:0:0:0: [sdb] No Caching mode page found
[420014.024112] sd 38:0:0:0: [sdb] Assuming drive cache: write through
[420014.026165]  sdb: 

minimonk@devmini:~/nfs/Ver1.0.1.12$ sudo fdisk /dev/sdb

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

minimonk@devmini:~/nfs/Ver1.0.1.12$ dmesg | tail
[420091.481789] sd 38:0:0:0: [sdb] No Caching mode page found
[420091.481807] sd 38:0:0:0: [sdb] Assuming drive cache: write through
[420091.483255]  sdb: sdb1 sdb2 sdb3 

음.. 그냥.. fdisk를 EOF로 해서 w 하도록 해야하나 -_-
2014/04/11 - [Linux] - 리눅스 쉘 스크립트 << EOF 를 이용해서 자동화 하기

partprobe 라는걸 해봤지만.. 안되네..

[링크 : http://2factor.tistory.com/49
[링크 : http://faq.hostway.co.kr/Linux_ETC/4528
[링크 : http://linux.die.net/man/8/partprobe]  

---
오!! 된다!!!
$ sudo hdparm -z /dev/sdb

/dev/sdb:
 re-reading partition table

minimonk@devmini:~/nfs/Ver1.0.1.12$ dmesg | tail
[437273.173713] sd 44:0:0:0: [sdb] No Caching mode page found
[437273.173729] sd 44:0:0:0: [sdb] Assuming drive cache: write through
[437273.175179]  sdb: sdb1 sdb2 sdb3


[링크: http://serverfault.com/questions/36038/reread-partition-table-without-rebooting ]

'Linux' 카테고리의 다른 글

tar 퍼미션 유지하기  (0) 2014.12.05
압축풀지 않고 tar 파일 용량 알아내기  (0) 2014.12.02
HPET - High Precision Event Timer / linux  (0) 2014.11.27
timezone  (0) 2014.11.21
dd 출력파일 자르지 않기  (0) 2014.11.20
Posted by 구차니