【教學】隨身攜帶的作業系統 ~安裝Linux作業系統於隨身碟~ [論壇 - Ubuntu 文件資源]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊

« 1 (2) 3 »


回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 0 / 898
MP : 664 / 28692
EXP: 92
離線
nana 寫到:
xenomorph0525 寫到:
嗯,還在用,
/etc/default/rcS 存在且有效。(至少UTC的部份是有效的)

為什麼這樣問?
是較新的發行版將它廢止了嗎?還是其他什麼狀況?

目前新出的LMDE都用 /etc/adjtime ,而LMDE是基於Debian製作的
我在想Ubuntu什麼時候會跟上
我查 man rcS 裡有這段
The UTC setting is replaced by the UTC or LOCAL setting in /etc/adjtime, and should have been migrated automatically.


因為好奇,所以研究了一下,先報告目前我發現的

以下在「Xubuntu 14.04」下測試的

執行下面的指令


$ dpkg -S rcS



發現


sysv-rc: /etc/init.d/rcS
initscripts: /usr/share/man/man5/rcS.5.gz
initscripts: /etc/default/rcS
sysv-rc: /etc/rcS.d
sysv-rc: /etc/rcS.d/README
upstart: /etc/init/rcS.conf




可以看到「/etc/default/rcS」是屬於「initscripts」這個套件



$ man rcS

其他版本
http://manpages.ubuntu.com/manpages/utopic/en/man5/rcS.5.html
http://manpages.ubuntu.com/manpages/vivid/en/man5/rcS.5.html

在「UTC」這段,沒看到adjtime相關的字眼


UTC This is used to govern how the hardware real time clock is interpreted when it is read (e.g., at boot
time, for the purpose of setting the system clock) and when it is written (e.g., at shutdown). If this
option is set to no then the system clock is assumed to be set to local time. If the option is set to
yes then the system clock is assumed to be set to something approximating Coordinated Universal Time
(UTC). (POSIX systems keep a variant of UTC, without leap seconds.)

On contemporary Debian systems (although change has been requested at http://bugs.debian.org/346342), if
UTC is set to no then /usr/share/zoneinfo must be readable early in the boot process. If you want to
keep /usr on a separate filesystem then you must still ensure that the target of /etc/localtime points
to the correct zone information file for the time zone of the time kept in your hardware real time




查詢「ubuntu etc adjtime」。

查到一篇「討論」提到



Re: /etc/adjtime

It's used by the hwclock utility, provided by the util-linux package.






$ man 8 hwclock

可以看到「/etc/adjtime」相關的字樣。




It works like this: hwclock keeps a file, /etc/adjtime, that keeps some
historical information. This is called the adjtime file.




執行


ls /etc/adjtime



顯示


ls: cannot access /etc/adjtime: No such file or directory



然後執行



$ dpkg -S /etc/adjtime


顯示


dpkg-query: no path found matching pattern /etc/adjtime



下載「util-linux」這個套件


$ apt-get download util-linux



解開


$ dpkg -x util-linux_2.20.1-5.1ubuntu20.7_amd64.deb util-linux



觀看「util-linux」資料夾結構


$ tree util-linux



顯示


util-linux
├── bin
│   ├── dmesg
│   ├── lsblk
│   ├── more
│   └── tailf
├── etc
│   ├── cron.weekly
│   │   └── fstrim
│   ├── default
│   ├── fstab.d
│   ├── init
│   │   ├── hwclock.conf
│   │   └── hwclock-save.conf
│   └── init.d
├── lib
│   ├── udev
│   │   └── rules.d
│   └── x86_64-linux-gnu
├── sbin
│   ├── agetty
│   ├── blkid
│   ├── blockdev
│   ├── cfdisk
│   ├── ctrlaltdel
│   ├── fdisk
│   ├── findfs
│   ├── fsck
│   ├── fsck.cramfs
│   ├── fsck.minix
│   ├── fsfreeze
│   ├── fstrim
│   ├── fstrim-all
│   ├── getty
│   ├── hwclock
│   ├── isosize
│   ├── mkfs
│   ├── mkfs.bfs
│   ├── mkfs.cramfs
│   ├── mkfs.minix
│   ├── mkswap
│   ├── pivot_root
│   ├── raw
│   ├── sfdisk
│   ├── swaplabel
│   ├── switch_root
│   └── wipefs
└── usr
├── bin
│   ├── addpart
│   ├── chkdupexe
│   ├── chrt
│   ├── ddate
│   ├── delpart
│   ├── fallocate
│   ├── flock
│   ├── getopt
│   ├── i386 -> setarch
│   ├── ionice
│   ├── ipcmk
│   ├── ipcrm
│   ├── ipcs
│   ├── line
│   ├── linux32 -> setarch
│   ├── linux64 -> setarch
│   ├── lscpu
│   ├── mcookie
│   ├── namei
│   ├── partx
│   ├── pg
│   ├── rename.ul
│   ├── resizepart
│   ├── rev
│   ├── setarch
│   ├── setsid
│   ├── setterm
│   ├── taskset
│   ├── unshare
│   ├── whereis
│   └── x86_64 -> setarch
├── lib
│   ├── mime
│   │   └── packages
│   │   └── util-linux
│   └── x86_64-linux-gnu
├── sbin
│   ├── cytune
│   ├── fdformat
│   ├── ldattach
│   ├── readprofile
│   ├── rtcwake
│   └── tunelp
└── share
├── doc
│   └── util-linux
│   ├── AUTHORS.gz
│   ├── changelog.Debian.gz -> ../libuuid1/changelog.Debian.gz
│   ├── copyright
│   ├── examples
│   │   ├── fstab.example2
│   │   ├── getopt-parse.bash
│   │   ├── getopt-parse.tcsh
│   │   └── sfdisk.examples.gz
│   ├── README.cfdisk
│   ├── README.Debian.hwclock
│   ├── README.fdisk.gz
│   ├── README.modems-with-agetty
│   └── README.poeigl.gz
├── info
├── lintian
│   └── overrides
│   └── util-linux
└── man
├── man1
│   ├── chkdupexe.1.gz
│   ├── chrt.1.gz
│   ├── ddate.1.gz
│   ├── dmesg.1.gz
│   ├── fallocate.1.gz
│   ├── flock.1.gz
│   ├── getopt.1.gz
│   ├── ionice.1.gz
│   ├── ipcmk.1.gz
│   ├── ipcrm.1.gz
│   ├── ipcs.1.gz
│   ├── line.1.gz
│   ├── linux32.1.gz
│   ├── linux64.1.gz
│   ├── lscpu.1.gz
│   ├── mcookie.1.gz
│   ├── more.1.gz
│   ├── namei.1.gz
│   ├── pg.1.gz
│   ├── readprofile.1.gz
│   ├── rename.ul.1.gz
│   ├── rev.1.gz
│   ├── setsid.1.gz
│   ├── setterm.1.gz
│   ├── tailf.1.gz
│   ├── taskset.1.gz
│   ├── unshare.1.gz
│   └── whereis.1.gz
├── man3
├── man5
├── man8
│   ├── addpart.8.gz
│   ├── agetty.8.gz
│   ├── blkid.8.gz
│   ├── blockdev.8.gz
│   ├── cfdisk.8.gz
│   ├── clock.8.gz -> hwclock.8.gz
│   ├── ctrlaltdel.8.gz
│   ├── cytune.8.gz
│   ├── delpart.8.gz
│   ├── fdformat.8.gz
│   ├── fdisk.8.gz
│   ├── findfs.8.gz
│   ├── fsck.8.gz
│   ├── fsck.minix.8.gz
│   ├── fsfreeze.8.gz
│   ├── fstrim.8.gz
│   ├── fstrim-all.8.gz
│   ├── getty.8.gz
│   ├── hwclock.8.gz
│   ├── i386.8.gz
│   ├── isosize.8.gz
│   ├── ldattach.8.gz
│   ├── lsblk.8.gz
│   ├── mkfs.8.gz
│   ├── mkfs.bfs.8.gz
│   ├── mkfs.minix.8.gz
│   ├── mkswap.8.gz
│   ├── partx.8.gz
│   ├── pivot_root.8.gz
│   ├── raw.8.gz
│   ├── resizepart.8.gz
│   ├── rtcwake.8.gz
│   ├── setarch.8.gz
│   ├── sfdisk.8.gz
│   ├── swaplabel.8.gz
│   ├── switch_root.8.gz
│   ├── tunelp.8.gz
│   ├── wipefs.8.gz
│   └── x86_64.8.gz
└── ru
└── man1
└── ddate.1.gz

33 directories, 153 files



沒有看到「/etc/adjtime」,所以「util-linux」,並不會安裝這個檔


查詢看看「/etc/adjtime」是不是安裝script產生的。


grep '/etc/adjtime' /var/lib/dpkg/info/*



顯示


/var/lib/dpkg/info/util-linux.postrm: rm -f /etc/adjtime



觀看「/var/lib/dpkg/info/util-linux.postrm」內容


cat /var/lib/dpkg/info/util-linux.postrm



顯示


#!/bin/sh -e

case "$1" in
remove)
;;
purge)
rm -f /etc/adjtime
;;
*)
;;
esac

if [ -x /usr/sbin/update-mime ]; then
update-mime
fi


# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section



看起來也不是「/etc/adjtime」安裝script產生的。


另外有查到一篇「Ubuntu Wiki / HardwareClock」,還沒讀懂 :p




以上初步報告


2015/9/23 10:17
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 36
HP : 0 / 898
MP : 664 / 28692
EXP: 92
離線
Marco 寫到:
samwhelp大大的口頭禪還挺文雅的。



老衲才疏學淺,生活範圍極小,能用的詞彙不多,稱不上文雅,Marco大俠,您過獎了。





Marco 寫到:
既然能灌到隨身碟上,
那,不知道有沒有可能灌到平板上?



目前極少使用行動裝置,所以對這方面尚未深究。

另外個人是蠻盼望Ubuntu,能在行動裝置佔有一席之地的。

行動裝置,常常安裝App時,會問你是否要允許存取xxx...(我也只用過Android的系統)

沒寫過行動裝置App的程式,我其實也不了解,允許後,到底允許存取了什麼,

但要使用該App,我常常都是得過且過的心態,允許存取。

因為不懂,所以會引發一些我個人資安上的疑慮!

也許行動裝置上,換了Ubuntu不見得不會發生這樣的情況!

但總是抱有期待,期待會有所不同!

以上是對這些資安上的概念,我處於未知的狀態,所引發的疑慮,進而的幻想,盼各位大德海涵

貧僧告退...

退駕!

:p

2015/9/23 12:27
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
會員三級
註冊日期:
2011/6/29 23:19
所屬群組:
已註冊使用者
等級: 10
HP : 0 / 237
MP : 43 / 8143
EXP: 49
離線
依法做了一個,
這帖真是帥翻了!

是說,我燒了三張dvd光碟,都開不了機(都卡在轉圈圈那裡),
後來只好試用隨身碟來開機安裝,竟 成功了~

用隨身碟有個地方要注意的是,
在分配安裝選項時,要將下方的

「開機裝置設定改成--在 sdb](這sdb就是目的碟) ,

這裡若不改,它會設在最上的 sda (原用來開機的碟)。
以上是在下的報告。

感謝 xenomorph0525
的這教學文~

2015/9/23 17:06
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
管理員
註冊日期:
2010/5/7 5:46
所屬群組:
已註冊使用者
討論區管理群
等級: 31
HP : 0 / 755
MP : 434 / 28474
EXP: 23
離線
debian系統時間設置
雙系統下Debian和Win7時間不同步
這兩篇的說法是Debian要用 adjtime ,可配合 hwclock 使用
/etc/default/rcS: UTC=no: Utopic time is off by 4 hours after boot #8
這篇有人說

Ah thanks. I think I understand this now, so setting to Triaged. Debian's systemd is using /etc/adjtime to indicate whether the hw clock is UTC or LOCAL, and masks /etc/init.d/hwclock.sh. But right now in Ubuntu we still use /etc/default/rcS's UTC= setting.

man rcS
rcS(5) Debian Administrator's Manual rcS(5)



NAME
rcS - variables that affect the behavior of boot scripts

DESCRIPTION
The /etc/default/rcS file contains variable settings in POSIX format:

VAR=VAL

Only one assignment is allowed per line. Comments (starting with '#') are also allowed.


OPTIONS
The following variables can be set.


TMPTIME
On boot the files in /tmp will be deleted if their modification time, file status time
and access time are all at least TMPTIME days ago. A value of 0 means that files are
removed regardless of age. If you don't want the system to clean /tmp then set TMPTIME
to a negative value (e.g., -1) or to the word infinite.


SULOGIN
Setting this to yes causes init to spawn a sulogin on the console early in the boot
process. If the administrator does not login then the sulogin session will time out
after 30 seconds and the boot process will continue.


DELAYLOGIN
Normally the system will not let non-root users log in until the boot process is com‐
plete and the system has finished switching to the default runlevel (usually level 2).
However, in theory it is safe to log in a bit earlier, namely, as soon as inetd has
started. Setting the variable to no allows earlier login; setting the variable to yes
prevents it.

Some details: The DELAYLOGIN variable controls whether or not the file /run/nologin is
created during the boot process and deleted at the end of it. The login(1) program
refuses to allow non-root logins so long as /run/nologin exists. If you set the vari‐
able to no then it is advisable to ensure that /run/nologin does not exist.


VERBOSE
Setting this option to no (in lower case) will make the boot process a bit less ver‐
bose. Setting this option to yes will make the boot process a bit more verbose.


FSCKFIX
When the root and all other file systems are checked, fsck is invoked with the -a
option which means "autorepair". If there are major inconsistencies then the fsck
process will bail out. The system will print a message asking the administrator to
repair the file system manually and will present a root shell prompt (actually a sulo‐
gin prompt) on the console. Setting this option to yes causes the fsck commands to be
run with the -y option instead of the -a option. This will tell fsck always to repair
the file systems without asking for permission.


ASYNCMOUNTNFS
Set this to 'no' to disable asynchronous mounting of network drives when the network
interfaces are mounted, and instead do it only once when the machine boots. The
default is 'yes'. It is useful to disable this on machines where the root file system
is NFS, until ifup from ifupdown works properly in such setup.


NOTE
The EDITMOTD, RAMRUN and UTC variables are no longer used. The RAMLOCK, RAMSHM and RAMTMP
variables have been moved to /etc/default/tmpfs; RAMSHM and RAMTMP settings in rcS are used
(if set) for backward compatibility, but will be overridden by settings enabled in
/etc/default/tmpfs. See tmpfs(5) for further details. The settings are not automatically
migrated to /etc/default/tmpfs. Please update /etc/default/tmpfs appropriately. The UTC setting is replaced by the UTC or LOCAL setting in /etc/adjtime, and should have been migrated automatically. See hwclock(5) and hwclock(8) for further details on configuring the system
clock.


AUTHOR
Miquel van Smoorenburg <miquels@cistron.nl> Roger Leigh <rleigh@debian.org>


SEE ALSO
fsck(8), hwclock(5), hwclock(8), inetd(8), init(8), inittab(5), login(1), tmpfs(5).



21 May 2012 rcS(5)

看來目前Ubuntu還是持續用 rcS ,Debian 在版本 7 的時候已改為 adjtime 的方式

2015/9/23 17:21
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
會員五級
註冊日期:
2009/10/29 4:50
所屬群組:
已註冊使用者
等級: 41
HP : 204 / 1021
MP : 928 / 40053
EXP: 87
離線
JR148 寫到:
依法做了一個,
這帖真是帥翻了!

是說,我燒了三張dvd光碟,都開不了機(都卡在轉圈圈那裡),
後來只好試用隨身碟來開機安裝,竟 成功了~

用隨身碟有個地方要注意的是,
在分配安裝選項時,要將下方的

「開機裝置設定改成--在 sdb](這sdb就是目的碟) ,

這裡若不改,它會設在最上的 sda (原用來開機的碟)。
以上是在下的報告。

感謝 xenomorph0525
的這教學文~


恭喜成功了。

我沒有考慮到Live USB的情況,
稍微改一下「一之3」項好了,
謝謝。

2015/9/23 19:04
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
會員五級
註冊日期:
2009/10/29 4:50
所屬群組:
已註冊使用者
等級: 41
HP : 204 / 1021
MP : 928 / 40053
EXP: 87
離線
mobile01上有這麼一篇文章:
http://www.mobile01.com/topicdetail.php?f=300&t=3690998

可見得隨身作業系統確實是一些人所想要的,
Linux的可攜性或許可以當作吸引Windows用戶的賣點也說不定。

2015/9/24 11:54
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
管理員
註冊日期:
2010/5/7 5:46
所屬群組:
已註冊使用者
討論區管理群
等級: 31
HP : 0 / 755
MP : 434 / 28474
EXP: 23
離線
xenomorph0525 寫到:
mobile01上有這麼一篇文章:
http://www.mobile01.com/topicdetail.php?f=300&t=3690998

可見得隨身作業系統確實是一些人所想要的,
Linux的可攜性或許可以當作吸引Windows用戶的賣點也說不定。

暈倒吧和暈倒石都可以把系統移到隨身碟喔,不過......
不是全功能,有限制。

2015/9/24 18:21
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
會員五級
註冊日期:
2009/10/29 4:50
所屬群組:
已註冊使用者
等級: 41
HP : 204 / 1021
MP : 928 / 40053
EXP: 87
離線
nana 寫到:
暈倒吧和暈倒石都可以把系統移到隨身碟喔,不過......
不是全功能,有限制。


是安裝到隨身碟?還是Live USB呢?
如果是前者,可以在別台電腦開機使用嗎?

Windows好久沒注意了,不知道現在有什麼特點。

2015/9/24 19:03
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
管理員
註冊日期:
2010/5/7 5:46
所屬群組:
已註冊使用者
討論區管理群
等級: 31
HP : 0 / 755
MP : 434 / 28474
EXP: 23
離線
xenomorph0525 寫到:

是安裝到隨身碟?還是Live USB呢?
如果是前者,可以在別台電腦開機使用嗎?

Windows好久沒注意了,不知道現在有什麼特點。

比較像移植啦,首先要有安裝好的系統。
在別台也可以開,不過還是有限制,比方驅動不合之類的,然後可以準備弄死自己的腦細胞(囧)。

2015/9/24 19:11
應用擴展 工具箱
回覆: [教學] 隨身帶著走的個人作業系統 ~Linux作業系統於隨身碟~
會員三級
註冊日期:
2006/11/10 20:25
所屬群組:
已註冊使用者
等級: 9
HP : 0 / 222
MP : 39 / 10640
EXP: 89
離線
xenomorph0525 寫到:
nana 寫到:
暈倒吧和暈倒石都可以把系統移到隨身碟喔,不過......
不是全功能,有限制。


是安裝到隨身碟?還是Live USB呢?
如果是前者,可以在別台電腦開機使用嗎?

Windows好久沒注意了,不知道現在有什麼特點。

呃~樓歪了....既然歪了,我也跟著歪一下好了,順便讓ubuntu知道隨身系統不是linux專有的....
因為對embedded system有興趣,所以從xp時代就在玩了,不過我是不玩xpe....原因,不喜歡它沒有xp全功能....
從系統來說:
xp最難移植,需要靠免費軟體來弄(USBoot),我是成功了,不成功的人也有一堆.
W7一開始找了很久的資料,大多需要靠對岸的軟體來弄,不過只要搞清楚原理後就明白w7原本就做好了,只是M$把它封印了,自已稍微動一下手腳不需靠額外的軟體對系統亂搞就OK了.
W8我只有在預覽版玩過,用W7相同的方法,不要用它的Win to go....超濫的,比我自己改的還慢還不穩,插別台電腦相容性超差的.

從媒體來說:
XP最會挑USB隨身碟跟SD卡,隨身硬碟幾乎不挑,但是不能在太多不同電腦上插....每插上一台不同廠的電腦就會重新安裝一堆不同的default driver,插多不同電腦就常常藍畫面了.
w7隨身硬碟幾乎不挑,但如要裝在隨身碟和SD卡上就必需要用特殊工具,雖然它號稱無毒,我也掃不出有毒,但我還是很難信任.隨身碟會挑,但比xp的狀況好多了,不過如果是用正版安裝的,在別台電腦會有硬體差異太大需要重新認證的問題,對於Intel CPU和AMD CPU必需各別做出不同版本的,不能混用,會開機藍畫面.
w8玩過它的win to go,實在是無法滿足我需求的穩定性,所以試著用w7的方式改造,結果成功了(win8預覽版,英文版),沒在繼續在正版時玩下去,因為我的正版w8讓我很感冒,真想跳回w7去.
w10沒玩過,因為是免費升上來的,我沒買原版的win10,無法測試.

總言之linux的隨身系統穩定性和硬體想容性比較高,win雖然比較挑比較難搞,但並非不行,有心的人上網多爬些文再花些時間去玩應該也能搞定.(別找我要教學...^^....)

2015/10/3 0:25
應用擴展 工具箱

« 1 (2) 3 »

 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.