linux – 创建没有mount的虚拟软盘映像?

有很多帖子要显示,以创建一个虚拟的软盘映像文件作为超级用户用户可以运行sudo命令.基本步骤是:

>通过dd命令创建空的1.44MB映像文件
>通过mkfs.msdos格式化图像文件
>将图像文件安装到某个安装点
>将东西复制到安装点
> umount虚拟软盘映像文件

我的问题是,如果我只是一个普通用户谁不能运行sudo命令,我该如何遵循上述步骤来创建一个虚拟的软盘映像和写一些东西?

非常感谢.

解决方法

是的,当然可以这样做.对于ext2文件系统,使用mtools作为FAT和e2tools或genext2fs.
$dd if=/dev/zero of=/tmp/disk1.img count=1440 bs=1k 
1440+0 records in
1440+0 records out
1474560 bytes (1.5 MB) copied,0.00569719 s,259 MB/s

$/sbin/mkfs.msdos /tmp/disk1.img 
mkfs.msdos 3.0.12 (29 Oct 2011)

$mdir -i /tmp/disk1.img
 Volume in drive : has no label
 Volume Serial Number is 9913-BFF6
Directory for ::/

No files
                          1 457 664 bytes free

$mcopy -i /tmp/disk1.img /etc/issue.net ::/
$mdir -i /tmp/disk1.img
 Volume in drive : has no label
 Volume Serial Number is 9913-BFF6
Directory for ::/

issue    net        28 2012-06-26  10:49 
        1 file                   28 bytes
                          1 457 152 bytes free

当然,我没有根本的权利.

相关文章

insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...