求教,挂载硬盘到/home目录作为数据盘,这样算是成功了么?
# dh -ls-bash: dh: command not found
# df -l
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9743696 1241148 799958814% /
/dev/xvda1 101086 36764 5910339% /boot
tmpfs 524380 0 524380 0% /dev/shm
# df -lh
Filesystem SizeUsed Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.3G1.2G7.7G14% /
/dev/xvda1 99M 36M 58M39% /boot
tmpfs 513M 0513M 0% /dev/shm
# sdisk -l
-bash: sdisk: command not found
# fdisk -l
Disk /dev/xvdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/xvdb doesn't contain a valid partition table
Disk /dev/xvda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks IdSystem
/dev/xvda1 * 1 13 104391 83Linux
/dev/xvda2 14 1044 8281507+8eLinux LVM
/dev/xvda3 1045 1305 2096482+8eLinux LVM
#
# fdisk -lh
fdisk: invalid option -- h
Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISKList partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors
# fdisk -l
Disk /dev/xvdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/xvdb doesn't contain a valid partition table
Disk /dev/xvda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks IdSystem
/dev/xvda1 * 1 13 104391 83Linux
/dev/xvda2 14 1044 8281507+8eLinux LVM
/dev/xvda3 1045 1305 2096482+8eLinux LVM
# cd /home
# dir
#
# fdisk -l
Disk /dev/xvdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/xvdb doesn't contain a valid partition table
Disk /dev/xvda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks IdSystem
/dev/xvda1 * 1 13 104391 83Linux
/dev/xvda2 14 1044 8281507+8eLinux LVM
/dev/xvda3 1045 1305 2096482+8eLinux LVM
# df -l
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9743696 1241148 799958814% /
/dev/xvda1 101086 36764 5910339% /boot
tmpfs 524380 0 524380 0% /dev/shm
# df -lh
Filesystem SizeUsed Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.3G1.2G7.7G14% /
/dev/xvda1 99M 36M 58M39% /boot
tmpfs 513M 0513M 0% /dev/shm
# fdisk -l
Disk /dev/xvdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/xvdb doesn't contain a valid partition table
Disk /dev/xvda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks IdSystem
/dev/xvda1 * 1 13 104391 83Linux
/dev/xvda2 14 1044 8281507+8eLinux LVM
/dev/xvda3 1045 1305 2096482+8eLinux LVM
# fdisk /dev/xvdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 2610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
Using default value 2610
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
# fdisk -l
Disk /dev/xvdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks IdSystem
/dev/xvdb1 1 2610 20964793+83Linux
Disk /dev/xvda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks IdSystem
/dev/xvda1 * 1 13 104391 83Linux
/dev/xvda2 14 1044 8281507+8eLinux LVM
/dev/xvda3 1045 1305 2096482+8eLinux LVM
# mkfs.ext3 /dev/xvdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2621440 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
160 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.Use tune2fs -c or -i to override.
# cd ~
# dir
gzidc
# dir home
dir: home: No such file or directory
# cd /home
# dir
# cd ~
# mount /dev/xvdb1 /home/
# df -h
Filesystem SizeUsed Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
9.3G1.2G7.7G14% /
/dev/xvda1 99M 36M 58M39% /boot
tmpfs 513M 0513M 0% /dev/shm
/dev/xvdb1 20G173M 19G 1% /home
# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devptsgid=5,mode=6200 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
# vi /etc/fstab
# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
/dev/xvdb1 /home ext3 defaults,noatime 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devptsgid=5,mode=6200 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
# passwd
Changing password for user root.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
# reboot
Broadcast message from root (pts/7) (Mon Jun 23 23:11:30 2014):
The system is going down for reboot NOW!
# 过程是没错,不过之前/home下的目录和文件是要在挂载前先拷出来的,挂载后在拷回去
回复 2# 的帖子
我的是重装系统之后挂载的,挂载了之后才安装lnmp0.9,这样需要复制出来么?谢谢军哥! 只要下面没数据就不用复制出来
页:
[1]