# ls -l /dev/sda
brw-r----- 1 root disk 8, 0 Jul 10 08:50 /dev/sda
# useradd fdiskuser
# su - fdiskuser
$ id
uid=521(fdiskuser) gid=521(fdiskuser) groups=521(fdiskuser)
$ ls -l /sbin/fdisk
-rwxr-xr-x 1 root root 96276 Feb 23 2012 /sbin/fdisk
$ fdisk
-bash: fdisk: command not found
$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home1/fdiskuser/bin
$ PATH=$PATH:/sbin
$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home1/fdiskuser/bin:/sbin
[fdiskuser@localhost ~]$ fdisk
Usage: fdisk [-l] [-b SSZ] [-u] device
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk /dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for the first PS/2 ESDI drive)
or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
...
$ fdisk -l /dev/sda
Cannot open /dev/sda
$ exit
# chmod u+s /sbin/fdisk
# ls -l /sbin/fdisk
-rwsr-xr-x 1 root root 96276 Feb 23 2012 /sbin/fdisk
# su - fdiskuser
$ id
uid=521(fdiskuser) gid=521(fdiskuser) groups=521(fdiskuser)
$ /sbin/fdisk -l /dev/sda
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 268 2048287+ 83 Linux
/dev/sda3 269 523 2048287+ 83 Linux
/dev/sda4 524 1044 4184932+ 5 Extended
/dev/sda5 524 587 514048+ 83 Linux
/dev/sda6 588 815 1831378+ 83 Linux
/dev/sda7 816 1044 1839411 83 Linux
'OS > [Linux] CentOS' 카테고리의 다른 글
[CentOS] 12. HDD 추가하기 (0) | 2016.07.10 |
---|---|
[CentOS] 11. vi 편집 (0) | 2016.07.10 |
[CentOS] 10-1. suidtest (0) | 2016.07.10 |
[CentOS] 9. 환경변수 테스트 (0) | 2016.07.10 |
[CentOS] 8. 권한연습 (0) | 2016.07.10 |