General TC > International Talk

(中文) How can I automatically load all partitions when tinycore starts?

<< < (2/26) > >>

polikuo:
Tiny Core is not your average linux system.
The /etc/fstab is rebuilt every time you boot, every time you plug-in a USB.
If I were you, I'd append this to /opt/bootlocal.sh (without "sudo")

--- Code: ---mount -t ntfs-3g /dev/sda2 /mnt/sda2
--- End code ---
and run a backup

--- Code: ---$ filetool.sh -bv
--- End code ---
Also, add "util-linux.tcz" and "ntfs-3g.tcz" into your /etc/sysconfig/tcedir/onboot.lst

However, before you do any of that, there's a huge problem with your setup.

--- Quote from: liuzhaoyzz on January 12, 2022, 07:09:46 PM ---my grub2 menu:
menuentry "/TinyCorePure64-12.0/boot/vmlinuz64" "/TinyCorePure64-12.0/boot/vmlinuz64" {
search --no-floppy --set --file $2
probe -u ($root) -s uuid
linux $2 quiet loglevel=3 tce=UUID="$uuid"/TinyCorePure64-12.0/cde/ showapps vga=791 lang=zh_CN.UTF-8 tz=GMT-8
initrd /TinyCorePure64-12.0/boot/corepure64.gz
}

--- End quote ---
Have you remastered your ISO and boot the system from there ?
How did you setup your system ?

Tiny Core本就不是一套常規的linux系統
/etc/fstab是會一直變的,你硬要改它也只會被刷掉而已。
我會這樣做,在/opt/bootlocal.sh加入mount指令。(切記,不要sudo)

--- Code: ---mount -t ntfs-3g /dev/sda2 /mnt/sda2
--- End code ---
然後備份一下

--- Code: ---$ filetool.sh -bv
--- End code ---
還有在你的onboot.lst加入"util-linux.tcz"跟"ntfs-3g.tcz"以便開機自動載入。
最後我要問你那個cde是哪來的?
你有自己動手魔改ISO檔嗎?你系統是怎麼裝的?

Rich:
Hi liuzhaoyzz
The attached script will mount all drives that have been detected but are not currently mounted.
After you have downloaded it, remember to make it executable:

--- Code: ---chmod 775 MountAll.sh
--- End code ---
Make sure you installed  ntfs-3g.tcz  onboot.

liuzhaoyzz:
非常感谢您的回复和指导!


--- Quote ---最後我要問你那個cde是哪來的?
--- End quote ---
原始的TinyCorePure64-12.0.iso用7z或者winrar解压缩之后,就是这个结构啊。我就是直接解压缩的。
tree /f .
卷 F2 的文件夹 PATH 列表
卷序列号为 00000200 0005:BF35
J:\TINYCOREPURE64-12.0
├─EFI
├─boot
└─cde
    │  copy2fs.lst
    │  onboot.lst
    │  xbase.lst
    └─optional
            Xfbdev.tcz
            Xfbdev.tcz.md5.txt


--- Quote ---你有自己動手魔改ISO檔嗎?你系統是怎麼裝的?
--- End quote ---
我没有改过TinyCorePure64-12.0.iso,我是直接解压缩,放到FAT32分区,然后添加引导罢了。

liuzhaoyzz:
mount -t ntfs-3g /dev/sda2 /mnt/sda2

我现在的主要问题是,在进入系统之前,我不知道设备号倒底是什么样子的,比如/dev/sda1,/dev/sdc3,dev/sda2,所以我想借鉴/usr/sbin/rebuildfstab里面的部分代码来实现遍历,自动挂载所有的分区。

liuzhaoyzz:
Thank you for your reply!
Make sure you installed  ntfs-3g.tcz  onboot.
Yes,I have installed ntfs-3g.tcz.

但是运行MountAll.sh挂载的话,FAT32和NTFS分区会出现乱码现象,这段代码和wbar-mounttool手工挂载分区没有区别,一样会产生乱码。
我想要实现的是,对于NTFS分区,用sudo mount -t ntfs-3g命令挂载,如果用sudo mount "/mnt/$F"会乱码。

对于FAT32分区,我想要用sudo mount -t vfat -o iocharset=utf8来挂载,如果用sudo mount "/mnt/$F"会乱码,因为sudo mount "/mnt/$F"缺乏-o iocharset=utf8参数。

所以我原本想利用rebuildfstab来修改,因为里面已经有了遍历的语句了。


Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version