Как изменить разрешение только на чтение для внешнего жесткого диска

Используйте этот (чистый bash) скрипт:

#!/bin/bash

# make the search case insensitive
shopt -s nocasematch
unset a; declare -A a

# read the name and save it in $name
read -p "Enter the Name: " name

# read the salary or profession and save it in $type
select type in salary profession;
do
  # loop trough the file
  while read l; do
    # characters 0 to 3 are the name
    n=${l:0:3}
    # the profession and the salary
    a["profession"]="${l:3:7}"
    a["salary"]="${l:10:5}"
    # if the name matches print the selected type
    [[ $n =~ $name ]] && echo "$n ${a[$type]}"
  done <file # the input file
  exit
done

Выход:

$ ./script
Enter the Name: ed
1) salary
2) profession
#? 1
Ted 30000
Ned 25000
$ ./script
Enter the Name: ted
1) salary
2) profession
#? 2
Ted Builder
$ ./script
Enter the Name:
1) salary
2) profession
#? 2
Bob Janitor
Ted Builder
Ned Fighter
Kit Teacher
0
17.02.2018, 14:19
2 ответа

Esto podría funcionar :Intente desmontar (se puede hacer con umount ), reinicie la PC e inicie sesión como root o haga sudo chroot 755 SU _DURO _DISCO _UNIDAD (si se monta, desmóntelo de nuevo )y luego móntelo manualmente (cree un subdirectorio en /mnt/ ejemplo "cd /mnt/, mkdir mntpnt1" )luego use el comando de montaje para montarlo en /mnt/ (o donde quiera ).

¿También hay alguna documentación del fabricante de la unidad de disco duro? Si es así, asegúrese de leerlo.

1
28.01.2020, 02:32

violamount -o remount,rw /path/to/remount

1
28.01.2020, 02:32

Теги

Похожие вопросы