# fdisk -lu /dev/vdb

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 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
# blkid /dev/vdb
/dev/vdb: UUID="047ad20b-3e2d-41d3-ba4d-72d22d5407d8" TYPE="ext3"
# e2fsck -n /dev/vdb
e2fsck 1.42.9 (28-Dec-2013)
Warning!  /dev/vdb is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
/dev/vdb: clean, 11/6553600 files, 459382/26214400 blocks
# df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/vda1       41151808  8534880  30503496  22% /
devtmpfs         1931336        0   1931336   0% /dev
tmpfs            1940844        0   1940844   0% /dev/shm
tmpfs            1940844      448   1940396   1% /run
tmpfs            1940844        0   1940844   0% /sys/fs/cgroup
tmpfs             388172        0    388172   0% /run/user/0
/dev/vdb       103081248 97838368         0 100% /home/wwwroot
# umount /dev/vdb
umount: /home/wwwroot: target is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
# fuser -m /home/wwwroot
/home/wwwroot:       24402
# kill 24402
# umount /dev/vdb
# fdisk -lu /dev/vdb

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 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
# fdisk -u /dev/vdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x56c34f1c.

Command (m for help): p

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 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 label type: dos
Disk identifier: 0x56c34f1c

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): d
No partition is defined yet!

Command (m for help): p

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 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 label type: dos
Disk identifier: 0x56c34f1c

   Device Boot      Start         End      Blocks   Id  System

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

Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xe00c1f00.

Command (m for help): d
No partition is defined yet!

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): 1
First sector (2048-209715199, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199):
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set

Command (m for help): p

Disk /dev/vdb: 107.4 GB, 107374182400 bytes, 209715200 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 label type: dos
Disk identifier: 0xe00c1f00

   Device Boot      Start         End      Blocks   Id  System
/dev/vdb1            2048   209715199   104856576   83  Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.
# lsblk /dev/vdb
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vdb    253:16   0  100G  0 disk
└─vdb1 253:17   0  100G  0 part
# e2fsck -n /dev/vdb1
e2fsck 1.42.9 (28-Dec-2013)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/vdb1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
# partprobe /dev/vdb
# resize2fs /dev/vdb1
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/vdb1
Couldn't find valid filesystem superblock.
# resize2fs /dev/vdb
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vdb is mounted on /home/wwwroot; on-line resizing required
old_desc_blocks = 7, new_desc_blocks = 13
The filesystem on /dev/vdb is now 52428800 blocks long.
# df -lh
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G  8.2G   30G  22% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  340K  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/vdb        197G   94G   95G  50% /home/wwwroot
tmpfs           380M     0  380M   0% /run/user/0

标签: none

添加新评论