mount 永久挂载 本地目录

[root@name01 Desktop]# fdisk -l


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b2584


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          39      307200   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              39         788     6016000   83  Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3             788        1045     2064384   82  Linux swap / Solaris


Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


[root@name01 Desktop]# df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             5.7G  5.2G  187M  97% /
tmpfs                 504M   76K  504M   1% /dev/shm
/dev/sda1             291M   32M  245M  12% /boot
[root@name01 Desktop]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x6d2a7f63.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.


Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)


WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').


Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1958, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1958, default 1958): 
Using default value 1958


Command (m for help): p


Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6d2a7f63


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1958    15727603+  83  Linux


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


Calling ioctl() to re-read partition table.
Syncing disks.
[root@name01 Desktop]# df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             5.7G  5.2G  187M  97% /
tmpfs                 504M   76K  504M   1% /dev/shm
/dev/sda1             291M   32M  245M  12% /boot
[root@name01 Desktop]# fdisk -l


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b2584


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          39      307200   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              39         788     6016000   83  Linux
Partition 2 does not end on cylinder boundary.
/dev/sda3             788        1045     2064384   82  Linux swap / Solaris


Disk /dev/sdb: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6d2a7f63


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1958    15727603+  83  Linux
[root@name01 Desktop]# mount /dev/sdb1 /
mount: you must specify the filesystem type
[root@name01 Desktop]# mkfs -t ext3 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
983040 inodes, 3931900 blocks
196595 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4026531840
120 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208


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


This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@name01 Desktop]# 


total 0
lrwxrwxrwx 1 root root 10 Jun 13 01:21 2ebaf8ae-1ece-46a4-a73f-a06260c5f1dc -> ../../sda3
lrwxrwxrwx 1 root root 10 Jun 13 01:21 4b7c12fc-5904-4740-9415-7226536ea39d -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 13 01:21 6379983d-c153-49a1-b689-e6184afa679d -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 13 01:21 6e428aef-f3cc-424a-bf48-e66a1a3e15fe -> ../../sda2
[root@name01 Desktop]# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Jun 13 01:21 2ebaf8ae-1ece-46a4-a73f-a06260c5f1dc -> ../../sda3
lrwxrwxrwx 1 root root 10 Jun 13 01:21 4b7c12fc-5904-4740-9415-7226536ea39d -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 13 01:21 6379983d-c153-49a1-b689-e6184afa679d -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 13 01:21 6e428aef-f3cc-424a-bf48-e66a1a3e15fe -> ../../sda2
[root@name01 Desktop]# df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             5.7G  5.2G  182M  97% /
tmpfs                 504M   76K  504M   1% /dev/shm
/dev/sdb1              15G  166M   14G   2% /store
/dev/sda1             291M   32M  245M  12% /boot
[root@name01 Desktop]# cat /etc/fstab


#
# /etc/fstab
# Created by anaconda on Mon Sep  9 04:49:54 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=4b7c12fc-5904-4740-9415-7226536ea39d /store                  ext4    defaults        1 2
UUID=6e428aef-f3cc-424a-bf48-e66a1a3e15fe /                       ext4    defaults        1 1
UUID=6379983d-c153-49a1-b689-e6184afa679d /boot                   ext4    defaults        1 2
UUID=2ebaf8ae-1ece-46a4-a73f-a06260c5f1dc swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
[root@name01 Desktop]# cd /
[root@name01 /]# ls 
bin   data  etc   lib         media  opt   root  selinux  store  tmp  var
boot  dev   home  lost+found  mnt    proc  sbin  srv      sys    usr
[root@name01 /]# 


reboot 完全没问题了
[root@name01 Desktop]# df -lh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             5.7G  5.2G  182M  97% /
tmpfs                 504M   76K  504M   1% /dev/shm
/dev/sdb1              15G  166M   14G   2% /store
/dev/sda1             291M   32M  245M  12% /boot
[root@name01 Desktop]# 



©️2020 CSDN 皮肤主题: 黑客帝国 设计师:上身试试 返回首页