Storage Device Manager - Worry-Free Fstab Configuration
Storage Device Manager provides an easy, non-technical GUI method to make changes to mounting options without manually editing any files. It does for mounting partitions what
StartUp-Manager does for editing grub's menu.lst. Storage Device Manager (PySDM) allows the full range of options available to those who manually edit fstab while simplifying the steps so that even beginners will feel comfortable making the same changes through Storage Device Manager. You no longer have to wonder if
relatime is really the correct spelling.
Note that pySDM is an older application that hasn't been updated recently. It has some limitations. For one, it does not make a back up copy of the
/etcfstab file. Secondly, it uses the older method of identifying partitions with "sdXX" in the fstab file. The preferred method, using UUIDs or labels, must be done outside of the pySDM application if desired.
Before proceeding, please note that there are some excellent references for further information regarding fstab located at the bottom of this guide.
Sections:
5 Minute Guide --- Installing & Starting --- Fstab Backup --- Using PySDM
When You Will Need Fstab --- Notes --- Partition Commands --- Links
1. Installing & Starting Storage Device Manager (PySDM)
Storage Device Manager is accessed via
System > Administration > Storage Device Manager. From the command line, start it with "
gksu pysdm". Root privilege is required since PySDM makes changes to system files.
gksu is the cousin of
sudo and should be used with graphical apps.
If Storage Device Manager is not in your menu, install it via synaptic (
System > Administration > Synaptic Package Manager ). If you don't see 'pysdm' listed in synaptic or the following command line method is not successful, go to
Synaptic > Settings > Repositories > Ubuntu Software and make sure the '
universe' repository is checked. Hit the 'Reload' button to refresh the package list and then select
pysdm. You can also install it via command line with:
Code:
sudo aptitude install pysdm
2. Backup Fstab
Before modifying any system file, it is good practice to make a backup copy. If you intend to make multiple changes
within a short time, I'd recommend assigning each backup a unique number (fstab.bak1, bak2, etc). To make a backup:
Code:
sudo cp /etc/fstab /etc/fstab.bak1
3. Using PySDM
The PySDM interface consists of 3 sections: the
Partition window for selecting the partition, the
General Configuration window for setting fstab options, and the
Dynamic configuration rules window for modifying hot-plug device and removable settings.
Partition List
When Storage Device Manager starts, it reads the devices/partitions available to it and displays them in the far left window. Starting with Hardy, Ubuntu no longer refers to devices as
hda even for IDE drives.
Select the partition which you want to mount by expanding the drive (sda, sdb, etc) and clicking on the triangle to the left of the individual partition (sda, sdb, etc). Until you select a partition the right side of PySDM will be grayed out and unavailable for input. If you don't know which partition you want to select, go to the
Which Partition? section at the bottom of this page for help. The first time PySDM works with a partition, even if an entry already exists in fstab, it will ask '
Configure Now? - click OK.
General Configuration
- Name
Name is the mountpoint you wish to use, by default a subfolder of /media and named the same as the partition (e.g. 'sda3'). You can choose a more descriptive name, such as 'my-data' or whatever you wish. The folder will be created if it does not exist. The folder created and/or selected should be empty - do not select a folder already containing files or subfolders. - Mountpoint
If you do not want to use /media as the base mountpoint you can choose a different folder by clicking on the folder icon and navigating to another folder. If you wish to make a new folder while navigating your system, click the 'new folder' at the top right of the navigation window. If you get 'lost' while navigating the folders, 'File System' in the left window will get you back to / . - Type
Take a breath and relax - you don't have to make a decision here. Type is just informing you the type of partition you are working with (e.g. ext3, ntfs, vfat). - Options
Here's the meat of the program. Initially 'Options' is set to 'defaults'. Clicking the 'Set Defaults' button also resets this window to 'defaults'. Selecting 'defaults' sets the following options: rw, suid, dev, exec, auto, nouser, async. Starting with Hardy, 'relatime' is also a default on native linux (i.e. ext2/3) partitions. For information on each of these settings, refer to the links at the bottom of this guide. If you add or change any options, 'defaults' will not be shown but will apply to any setting not overridden. One other note, in addition to automatic entries, anything you type in this window will be input in the options section of fstab. For instance, there is no option to set dmask or fmask but you can add them to the options line and they will be applied along with the other settings. All options are joined by commas with no spaces in the entire section. - Assistant
This section could also be called 'More Options' since it is the section in which you can change settings from 'defaults'. Most of the settings are self-explanatory. The setting options presented vary with the type of partition selected (ext3, ntfs, fat32, etc). I will comment on a few of the options you may wish to consider changing. Any change you make in these sections will remove the 'defaults' option from the main window and non-default options will be displayed. Default settings will still apply to those settings which are not overridden.
Auto-selected items are colored blue. Black Bold items are the actual designations that appear in the fstab options section when selected. Default options are underlined. They will NOT appear in fstab but apply unless the associated non-default option is entered.
* Items which should be considered. Author recommendations are listed in green.
- Mounting Tab
- * Mount read-only *. ro The Read-Only option is OFF (rw) for linux ext2/3 partitions and ON* (ro) by default for VFAT/NTFS partitions. For VFAT/NTFS partitions, this option must be unchecked to enable read/write. For non-linux partitions, the PySDM umask (and dmask/fmask manual entries) setting can allow RW access for non-linux partitions even if RO is enabled.
- Allow group mount. group= Allow any group member to mount. Enter group id.
- * Allow any user to mount. users Normally the option would allow a user to click on a partition icon or use the 'mount /dev/sdXX' option to mount the partition without root privileges. If this option doesn't work for NTFS partitions try mounting via terminal. If you get an 'Unprivileged user' message, see the section at the bottom of the page on NTFS-3g errors.
- * Allow a user mount. nouser/user
- File system mounted at boot time. auto/noauto
- Owner of device can mount. owner
- Owner user of filesystem . uid= Enter uid in window. Whoever mounts the device owns it. Your uid is normally 1000 if you are the primary user. To check, run the following command in terminal: id. You may wish to select this option.
- Support extended attributes. --/user_xattr (Linux partitions only).
- * Check file system on mount time. (Linux partitions only). This command is no longer supported and may produce an error message. Do not select it. Fsck checks are no longer included in the options section; they are now handled by the last digit on the line (normally 0, 1 or 2).
- * Umask. 000 (Non-linux partitions only). This is an entire subject in itself. The PySDM menu does not offer dmask and fmask value inputs for ntfs/fat partitions. You can manually enter them them in the Options window if you wish.
On NTFS partitions, if the fstab options are left at "defaults" the mountpoint and all folders/files will be owned by root but readable/writable by the user. If uid/gid options are used, the mountpoint is still owned by root but all subfolders and files are owned by the user specified by "uid=".
Refer to the Permissions link at the bottom of the page for more information. Here are some common umask settings you may wish to consider:
000 (Permissions 777) - Default PySDM setting. Anyone can do anything!
022 (Permissions 755) - Owner read/write/execute (rwx), group (rx), others (rx).
027 (Permissions 750) - Owner rwx, group rx, others can't access partition.
077 (Permissions 700) - Only the owner can rwx, group and others cannot access partition.
* Instead of umask, dmask & fmask can be used but must be entered manually on the Options line. Two useful settings would be:
dmask 027,fmask137 - Owner has rwx for directories, rw for files. Group has rx for dirs and r for files.
dmask 000,fmask111 - Owner rwx dirs, rw files. Group rwx dirs, rw files. Others rwx dirs, rw files.
Deselect umask if dmask/fmask settings are entered in the Options window. - Owner group of filesystem. gid=
- Special Files
- Permit execution of binaries. exec/noexec If unchecked, this option prevents execution of program files within the partition. This may be desirable for a storage or data partition which nevertheless contains executable files. Unchecking this box will also disable the warning message in nautilus and other applications which asks if you want to run the file or open it. If not checked, the file will open without the query.
- Permit executables to change user/group identity. suid/nosuid Relates to scripts. Note: If you need to know about this, you probably don't need PySDM!
- Interpret character or special block devices. dev/nodev See note in previous entry!
- Journaling (Linux partitions only)
- Specify a journaling mode. /data= Ordered, journal or writeback.
- Update journal or specify the inode where it is. journal=
- Do not load journal on mounting. noload
- Performance
This section deals with recording data access times and synchronization matters. User input is not normally required. Many items apply to linux partitions only.
- Update directory time for each access. diratime/nodiratime
- I/O to file system should be done synchronously. async/sync
- All directory updates should be done synchronously . nodirsync/dirsync
- Update file time for each access. atime/noatime
- Specify what to do in case of errors=. remount-ro/continue/panic Really, panic is an option..
- Do not attach buffer_heads to file pagecache.
- Get group id from the directory for a new file.
- Synchronize data and metadata every specified seconds. commit=
- Use a especific block as superblock. sb=
- Use old new inode allocator.
- Miscellaneous
This section deals with network file systems, default character encoding, UFT-8 file name conversion, upper/lower case interpretation, and escape sequences. The default character set is the older iso8859-1. If your system is having trouble reading the directory or file names, changing these settings may help.
- File system requires network. _netdev
Linux partitions (ext2/ext3) only: - User allowed to use reserved space. resuid=
- Group allowed to use reserved space. resgid=
- Support POSIX access list.
- Disables 32 bit user and group id.
- Print debugging info.
- Minix behavior for stat information.
Non-Linux only: - * Character set to use for file names. nls=iso8859-1 The english-speaking standard of iso8859-1 is the default and checked, The mount man page uses the iocharset=8859-1 . If this is listed in the Options window, I recommend changing nls= to iocharset= I personally turn it off by deselecting it..
- * Use UTF-8 for converting file names. utf8 Select this for ntfs and vfat (fat16/32) partitions.
- Update file time for each access. posix
- Use escape sequences for unknown characters. uni_xlate=
- Mount Button
You can mount and unmount the selected partition by clicking on this button. Cycling Unmount > Mount will allow the options you have designated to take effect. It is equivalent to running the 'sudo umount' and 'sudo mount' commands on the particular partition. - Apply Button
Finallly! Clicking this button applies the changes. In fstab, the revised or new entries are placed at the bottom of the file. PySDM at present does not use UUID's or LABEL designations. If you have entries in fstab that use either of these designations, they will either remain unchanged or become comments. The '/dev/sdXX' line generated by PySDM will appear below previous entries in the /etc/fstab file. In this case, even though there are multiple entries for the same partition, the PySDM lines will be loaded last and thus will take precedence over earlier lines.
Dynamic Configuration Rules
This section enables you to set
udev rules. Click on the '
New' button and you can set the conditions of Name, Model, Vendor, and bus type.
After setting specifications to identify the device, you can set the user, group, device file name, and specify user's rights. You can also create a link with a name of your choosing. The settings are stored in /etc/udev/user.rules. For more information about udev configuration refer to the man page (
man udev) or the link at the bottom of this guide.
4. When You Will Need Fstab (and How to Do It)
While PySDM offers an easy and safe way to change or create partition mounting instructions, there are several reasons why you might wish to edit fstab manually.
Before modifying any system file, it is good practice to make a backup copy.
Code:
sudo cp /etc/fstab /etc/fstab.bak
gksu gedit /etc/fstab
- Refer to the instructions in the '3 Minute Guide' Removable Drives section for how to make the following changes.
- UUIDs. PySDM currently does not use UUIDs. If your fstab contains a UUID entry and you attempt to create a new listing for the same partition PySDM will create a "/dev/sdXX" entry at the bottom of the file. PySDM will either place a comment (#) symbol at the start of the original line and/or will override the UUID entry by placing the PySDM-generated entry at the bottom of fstab. A technique if you would like to retain the UUID entry would be to generate an fstab entry with PySDM, copy the options to the UUID line, and then delete the remainder of the PySDM entry. Remember that since PySDM does not use UUIDs, it will not update them if they are changed due to repartitioning.
- LABELS. PySDM currently does not use labels. Read the previous entry on UUIDs. The same technique applies for labels.
- /dev Designations. Some users prefer not to use /dev designations. In the past some updates/upgrades changed the letter designations of partitions. Since Hardy now uses the /dev/sdXX designation, there should be no more unrequested changes from /dev/hdXX to /dev/sdXX or vice versa. If you don't want to use the /dev designations run PySDM and then replace the /dev/sdXX designation with the UUID or label. (see commands below for determining these)
- FSCK Entries. The last digit in an fstab entry is provides instructions for fsck (disk checking).
The last digit relays the following instructions to fsck:
0 - Do not check. (This should always be the setting for non-linux partitions.)
1 - Check first. (Root)
2 - Perform check with a lower priority than 1 (when running during the same session).
PySDM always creates a listing with the FSCK option set at '0'. If you want to change this you will need to edit fstab and change the setting.
5. Notes & Additional Information
How Do I Know Which Partition to Choose?
When adding a new device or after partitioning a drive, you may not be sure which partition you want to select. One method you can try is to watch the list as the device is plugged in. If it may be mounted, run "sudo umount -a". There will be some busy messages but it won't hurt anything. Then plug in the device and see if it mounts by watching the
Partition List window to see if it appears. Normally PySDM will place this 'new' device at the bottom of the list, even if the letter designation is lower than some already displayed. You can use some of the commands listed later in this section to help you investigate your system's partition information. Some of the following characteristics may help you determine the partition:
- Size - Approximate size of the partition: df -h
- Formatting - Type of formatting: df -T | grep "/dev/"
- Bootable - Bootable Partitions: sudo fdisk -l | grep "*"
- View Everything - sudo fdisk -l && sudo blkid && df -Th && cat /etc/fstab && mount
'Unprivileged User' NTFS Errors
NTFS-3g was incorporated in Hardy and is enabled by default. Nevertheless, it is possible to get an error message when trying to mount an NTFS partition as a specific user. The error message is:
- Unprivileged user can not mount NTFS block devices using the external FUSE library. Either mount the volume as root, or rebuild NTFS-3G with integrated FUSE support and make it setuid root. Please see more information at http://ntfs-3g.org/support.html#unprivileged
To correct this condition:
Code:
sudo chown root $(which ntfs-3g)
sudo chmod 4755 $(which ntfs-3g)
6. Useful Partition Commands (Results in italics)
What partitions are currently mounted?
mount
/dev/sda5 on / type ext3 (rw,errors=remount-ro)
What is contained in my fstab (to exclude commented lines, add [
| grep -v "#" ]?
cat /etc/fstab
# Entry for /dev/sda5 :
UUID=4d33bfe6 / ext3 defaults,errors=remount-ro 0 1
What is the UUID / LABEL of my partition?
sudo blkid -c /dev/null
/dev/sda1: UUID="CEECFF9EECFF7F51" TYPE="ntfs"
What partitions are on my computer (note the switch is a small L)?
sudo fdisk -l
/dev/sda5 * 2804 4078 10241406 83 Linux
How much space do I have on my partitions?
df -Th
/dev/sda5 ext3 9.7G 3.9G 5.4G 42% /
How do I make a label for my NTFS partition? (Install
ntfsprogs first)
sudo ntfslabel <device> <label>
sudo ntfslabel /dev/sda5 MYLABEL
How do I make a label for my ext2/3 partition? (Install
e2fsprogs first)
sudo tune2fs -L <label> <dev>
sudo tune2fs -L MYLABEL /dev/sda5
How do I make a label for my fat32 partition?
Warning: This overwrites any data on the partition.
sudo mkfs.vfat -F32 -n <label> <device>
sudo mkfs.vfat -F 32 -n MYLABEL /dev/sda5
sudo mkfs.vfat -F32 -n /dev/sdc 1 usb.5
7. Links
Ubuntu Community Related Links
Introduction to Fstab
UsingUUID
LinuxFilesystemsExplained
RenameUSBDrive (Really - How to Label Any Format)
MoveMountpointHowto
MountingWindowsPartitions
Other Links
Understanding fstab How to edit & understand /etc/fstab Understanding & Using File Permissions
PyGTK Storage Device Manager
Writing udev Rules
What's With the Name PySDM?
PySDM runs a PyGTK graphical interface = py for the python wrapper and GTK for the Gimp Tool Kit.
Bookmarks