How to create /etc/fstab automaticly? ‚How to create /etc/fstab automaticly?‘ I was asked once by my brother (aka „Will“). My answer was very simple (like my english): „By using a Bash script“. But there are no good bash scripts to do it… (Knoppix etc does it too, but not as preciesly as my brother would like to). So he wrote it by himself… What does it do?
1) It checks what do you have in /etc/fstab
2) It checks which partitions you have (Known types: Linux = auto [kernel driver will decide], Windows = fat32 [vfat], Windows NT partitions = NTFS [using ntfs-g3 driver – you should have it in your system], Linux swap partitions)
3) It makes dirs in /mnt/ (or other -> see options) and mount -a
4) Also swap partitions
How to use it?
1) Put the script in a file like /etc/rd.d/fstab_and_mnt.sh
2) Edit and change options
# Mountpoint:
MountPoint=mnt
#NTFS Driver avalible options: ntfs-3g; fuse; ntfs
NtfsDriver=ntfs-3g
3) chmod file with 755: „chmod 755 /etc/rd.d/fstab_and_mnt.sh“
4) Run: „/etc/rd.d/fstab_and_mnt.sh rebuild“
=================== Script follows ============================
(mehr …)