将fat32 8G U盘作为ftp的挂载盘

1. 对fat32 8G U盘分区。
stan@ubuntu:~$ sudo  fdisk  /dev/sdb
Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-15633407, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15633407, default 15633407):
Using default value 15633407

Command (m for help): p

Disk /dev/sdb: 8004 MB, 8004304896 bytes
35 heads, 21 sectors/track, 21269 cylinders, total 15633408 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: 0x7523bf12

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    15633407     7815680   83  Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.
stan@ubuntu:~$ sudo  fdisk  -l /dev/sdb

Disk /dev/sdb: 8004 MB, 8004304896 bytes
33 heads, 21 sectors/track, 22559 cylinders, total 15633408 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: 0x7523bf12

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    15633407     7815680   83  Linux

2. 对  8G U盘linux格式化。
stan@ubuntu:~$ sudo mkfs -t ext3   /dev/sdb1
mke2fs 1.42 (29-Nov-2011)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
488640 inodes, 1953920 blocks
97696 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2004877312
60 block groups
32768 blocks per group, 32768 fragments per group
8144 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks):
done
Writing superblocks and filesystem accounting information: done

3.挂载u盘到mnt/usb目录下,设定U盘的用户属性ftp,以便vsftpd访问。
stan@ubuntu:/$ sudo mount /dev/sdb1   /mnt/usb
stan@ubuntu:/etc$ cd /mnt/usb
stan@ubuntu:/mnt/usb$ ls -al
total 28
drwxr-xr-x 4 root root  4096 Nov 17 00:33 .
drwxr-xr-x 5 root root  4096 Nov 17 00:32 ..
drwx------ 2 root root 16384 Nov 17 00:30 lost+found
stan@ubuntu:/mnt/usb$ sudo chown ftp:ftp . -R
stan@ubuntu:/mnt/usb$ ls -alt
total 28
drwxr-xr-x 4 ftp  ftp   4096 Nov 17 00:33 .
drwxr-xr-x 5 root root  4096 Nov 17 00:32 ..
drwx------ 2 ftp  ftp  16384 Nov 17 00:30 lost+found


4.卸载u盘,将u盘重新挂载到ftp目录下
stan@ubuntu:/$ sudo mount /dev/sdb1   /srv/ftp/ftp

5. 用filezila访问即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值