USB HD를 자동 마운트하려면 어떻게 해야 합니까? usbmount를 설치했지만 작동하지 않는 것 같습니다. 다음은 몇 가지 세부정보입니다.
sudo fdisk -lu:
Disk /dev/sda: 20.4 GB, 20416757760 bytes
255 heads, 63 sectors/track, 2482 cylinders, total 39876480 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: 0x000859fe
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 38238207 19118080 83 Linux
/dev/sda2 38240254 39874559 817153 5 Extended
/dev/sda5 38240256 39874559 817152 82 Linux swap / Solaris
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x0000d617
Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 972597247 486297600 83 Linux
/dev/sdb2 972599294 976771071 2085889 5 Extended
/dev/sdb5 972599296 976771071 2085888 82 Linux swap / Solaris
Disk /dev/sdc: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders, total 78165360 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: 0x43ba43ba
Device Boot Start End Blocks Id System
/dev/sdc1 * 63 78140159 39070048+ 7 HPFS/NTFS/exFAT
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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: 0x000c85ff
Device Boot Start End Blocks Id System
/dev/sdd1 63 1953520064 976760001 7 HPFS/NTFS/exFAT
Disk /dev/sde: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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: 0x48686a76
Device Boot Start End Blocks Id System
/dev/sde1 63 2930272064 1465136001 7 HPFS/NTFS/exFAT
sudo blkid:
/dev/sda1: UUID="70d2b83a-1b0a-4c5d-b6ff-89d187b4c96a" TYPE="ext4"
/dev/sda5: UUID="444db037-76b9-4a53-b357-ab5ae1764044" TYPE="swap"
/dev/sdb1: LABEL="500GB" UUID="7c0f92c4-3428-4e0a-b724-abe13229224c" TYPE="ext4"
/dev/sdb5: UUID="370e0ecf-3190-4fe8-92d3-13cb1fedecb1" TYPE="swap"
/dev/sdc1: LABEL="admin_only" UUID="528b53ef-15ac-4a2d-ad97-425af3a61995" TYPE="ext4"
/dev/sdd1: LABEL="Hitachi" UUID="e7f30f9f-2d42-4222-bce3-4b58d65c26e3" SEC_TYPE="ext2" TYPE="ext3"
/dev/sde1: LABEL="Toshiba" UUID="5c61d0bd-eb41-4a8e-aa4e-b6db05d1b43e" SEC_TYPE="ext2" TYPE="ext3"
산:
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
감사합니다!
답변1
USB 장치가 연결되면 프로브됩니다. 최신 Linux가 배포되어 있으면 udev 규칙이 트리거됩니다. (보다 /etc/udev/rules.d
& /lib/udev/rules.d
).
해당 규칙을 사용하여 스크립트를 실행할 수 있습니다. 그런 다음 해당 스크립트는 드라이브 레이블을 읽고 이를 기반으로 특정 작업을 수행할 수 있습니다(예: 레이블이 'backup_drive_1'인 경우 해당 드라이브에 대해 rsync /data).
그러나 나는 그것을 직접 시도하지 않았습니다. 내가 가지고 있는 것은 그것을 수행하는 방법에 대한 관심과 몇 가지 편리한 링크뿐입니다. (제 경우 목표는 mdadm 미러를 특정 USB 드라이브에 다시 동기화하는 것이었습니다).
그럼에도 불구하고 이러한 링크는 귀하를 올바른 길로 안내할 수 있으며 누군가가 준비된 답변을 게시할 수도 있습니다.
- http://reactivated.net/writing_udev_rules.html#external-run
- https://unix.stackexchange.com/questions/5623/what-happens-when-a-usb-drive-is-plugged-in
- http://ubuntuforums.org/showthread.php?t=168221
- https://stackoverflow.com/questions/469243/how-can-i-listen-for-usb-device-inserted-events-in-linux-in-python
답변2
/etc/fstab에 추가하면 됩니다.
UUID=your-uuid-goes-here /where-to-mount-goes-here ext4 defaults 0 2
NTFS 예:
UUID=your-uuid-goes-here /where-to-mount-goes-here ntfs-3g defaults,auto,umask=000,users,rw 0