Skip to content

Instantly share code, notes, and snippets.

@sergeifilippov
Created December 4, 2013 23:07
Show Gist options
  • Save sergeifilippov/7797282 to your computer and use it in GitHub Desktop.
Save sergeifilippov/7797282 to your computer and use it in GitHub Desktop.
Mounting a partition/drive with out execration parameters

mount a partition with out execution enabled - for security

make a mounting point

sudo mkdir /mnt/mounting_point

find the drive to mount

sudo blkid

output eg.

$ sudo blkid
/dev/xvda: UUID="bd02b157-..." TYPE="ext3" LABEL="os"
/dev/xvdb: UUID="41214e24-..." TYPE="swap"
/dev/xvdc: UUID="4d3f3fb0-..." SEC_TYPE="ext2" TYPE="ext3" LABEL="mountme"

label the drive for easy reference

sudo e2label /dev/xvdc mountme

confirm it worked

$ sudo blkid
....
/dev/xvdc: UUID="4d3f3fb0-..." SEC_TYPE="ext2" TYPE="ext3" LABEL="mountme"

update the /etc/fstab for auto mounting in the future

# mount backup
LABEL=mountme /mnt/mounting_point ext3 defaults,nosuid,noexec,nodev 1 2

mount without rebooting

sudo mount -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment