I've created a file and formated it.  # fallocate -l 1g /foo.img # mkfs -t ext4 /foo.img   I can mount it using  # mount /foo.img /bar   But how can I make it permanent?
63616
I am using Ubuntu Minimal + LXDE. I am wondering how can I auto-mount a partition (internal) on boot automatically. Currently I do something like   mount /dev/sda3 /media/works   But I want it to be permanent. Also I have GParted, but the Partition > UnMount is greyed out (yes, unmount, even though I haven't mounted it)
122965
Can I mount /data/data/com.termux/ folder on external sd card? My phone is rooted Android 10 and running low of internal storage. As I read from  mounting to /sdcard requires permission to mount because /sdcard is emulated from /data/media/0 and /data/data/ is not. And from  it can mount /data/data/com.termux/ using ln -s because ext4 support links while fat doesn't. I don't know how /data/data/ directory works but is it possible to mount /data/data/com.termux/files/home/ directory to external sd card without formatting it as adoptable storage or making ext4 partition?
110860
I previously used to create image files using dd, set up a filesystem on them using mkfsand mount them to access them as mounted partitions. Later on, I have seen on the internet that many examples use losetup beforehand to make a loop device entry under /dev, and then mount it. I could not tell why one would practically need an image file to behave as a loop device and have its own /dev entry while the same behaviour can be obtained without all the hassle.   Summary: In a real-life scenario, why do we need a /dev/loopXentry to be present at all, when we can just mount the fs image without it? What's the use of a loop device?
53206
Let's say user has Directory1 and it contains File1 File2 CantBeDeletedFile How to make so the user would never be allowed to delete the CantBeDeletedFile?  If I change the ownership of Directory1 and remove write permissions users wouldn't be able to delete any file. They also wouldn't be able to add new files etc.  I just want to be able to set some files which would never be deleted.  More specific description.  I am creating user profiles. I am creating application launcher files in their Desktop. So I want to set some launcher files (.desktop) and make them so user can only launch them and they couldn't rename nor delete, just launch.  Currently if user owns the directory which contain any file. He can delete.  If there is no generic way for all *nix, it's a Linux and ext4 FS.
116944
My /usr folder needs to get moved to a new partition. How can I do this without erasing the contents?  Can this be done while Ubuntu is running, or do I need to use the LiveCD for this?
62533
I can successfully mount an ext4 partition, the problem is that all the files on the partition are owned by the user with userid 1000. On one machine, my userid is 1000, but on another it's 1010. My username is the same on both machines, but I realise that the filesystem stores userids, not usernames.  I could correct the file ownership with something like the following:  find /mnt/example -exec chown -h 1010 {} \;   But then I would have to correct the file ownerships again back to 1000 when I mount this external drive on another machine.  What I would like is to give mount an option saying map userid 1000 to 1010, so that I don't have to actually modify any files. Is there a way to do this?
40749
When I mount the logical volume through Unity dash or the File Manager it creates the mount point at /media/$USER/557808d2-b3a5-4bf2-b84b-93a3b42ce36a.  I want to change the volume label from 557808d2-b3a5-4bf2-b84b-93a3b42ce36a to some simple string like 'data' and keep it as it is permanently, so that it wont change next time when I mount it.  How do I do that?
60409
I am looping through a number of files, and $file represents the current file.  How can I make copies or renames and keep the extension the same for this current file?  e.g. if $file = x.jpg  How to make a copy of $file's with a filename of x_orig.jpg  So far I have:  for file in /tmp/p/DSC*.JPG; do   cp $file $file+'_orig'.JPG done   but that copies the file  DSCF1748.JPG   to  DSCF1748.JPG+_orig.JPG   whereas I want a copy named  DSCF1748_orig.JPG   Similarly, using cp $file "$file"_orig.JPG  results in files such as DSCF1748.JPG_orig.JPG  I want to get the _orig in the middle of the filename...
97649
How will I make this /media/De Soft/mongodb/bin PATH variable permanent?  Everyone is saying "export PATH=$PATH:media/De\ Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv depending on your shell".   I don't know what is ~/.profile, or .bashrc, or .zshenv. What do they do actually?  How will I add export PATH=$PATH:my/path to my .profile/.bashrc/.zshenv?   I'm using 64 bit Ubuntu 14.04 LTS with default terminal.
106173
I recently made changes to my fstab file and, upon reboot, noticed I had an error in it. I get the typical mount error on boot. I went to try and modify it by entering the read-only mode but then, since it's read only, I can't access it. Is there a way around this or some way to delete the file so I can use the backup (which I'm pretty sure works)?
57357
How do I safely delete all files with a specific extension (e.g. .bak) from current directory and all subfolders using one command-line? Simply, I'm afraid to use rm since I used it wrong once and now I need advice.
8400
I want to make a persistent live Ubuntu USB drive with more than 4GB of storage.   I know there is an option of installing directly on the drive but I don't want to do this as it will restrict the drive from working on different computers.   One option is to make an additional partition with extra space but if I do this how can I get newly installed software to be stored on this partition?
72388
I currently have a Windows 10 pen drive that isn't in use at the moment. I try to format the drive on disks, and the terminal using mkfs.vfat /dev/sdc1 and all I get is;  mkfs.fat 4.1 (2017-01-24) mkfs.vfat: unable to open /dev/sdc1: Read-only file system   Is there a way to format this to any file system? I'd like to use it for other things.
23448
I managed to make a directory literally named ~.  (Apparently, Python's os.mkdir('~/something') does this.)  How do I remove it without nuking my home?  Also, if it helps, I have my real /home on a separate partition. And the duplicate ~ is located in (the real ) ~.
74835
Can I mount a file system image without root permission? Normally I would do:  mount -o loop DISK_IMAGE FOLDER   Without using sudo or setting the suid on mount, is there any suitable way to do this?  I know I can use fusermount with some ISO images, but that is pretty limited, even for ISO images, some of my images cannot be mounted, but mount always works.
109070
I have a source file for an icon. It has a base layer which is the icon background, and a number of layer folders, each of which contains layers for each individual icon. There are 20 or so of these folders. To save the icon set, I need to:   Make the base layer visible, and hide all other layers Show the folder of the icon I want to save Save the file, with an appropriate name (the name of the folder) Hide that folder. Repeat steps 2-4 for every folder   I've played around with the scripting in Photoshop but haven't been able to make something that does this automatically (it's an annoyingly time-consuming operation). Is it possible?
64161
I have a text file, "foo.txt", that specifies a directory in each line:  data/bar/foo data/bar/foo/chum data/bar/chum/foo ...   There could be millions of directories and subdirectories What is the quickest way to create all the directories in bulk, using a terminal command ?  By quickest, I mean quickest to create all the directories. Since there are millions of directories there are many write operations.   I am using ubuntu 12.04.  EDIT: Keep in mind, the list may not fit in memory, since there are MILLIONS of lines, each representing a directory.  EDIT: My file has 4.5 million lines, each representing a directory, composed of alphanumeric characters, the path separator "/" , and possibly "../"  When I ran xargs -d '\n' mkdir -p &lt; foo.txt after a while it kept printing errors until i did ctrl + c:  mkdir: cannot create directory `../myData/data/a/m/e/d': No space left on device  But running df -h gives the following output:  Filesystem      Size  Used Avail Use% Mounted on /dev/xvda        48G   20G   28G  42% / devtmpfs        2.0G  4.0K  2.0G   1% /dev none            401M  164K  401M   1% /run none            5.0M     0  5.0M   0% /run/lock none            2.0G     0  2.0G   0% /run/shm   free -m   total       used       free     shared    buffers     cached Mem:          4002       3743        258          0       2870         13 -/+ buffers/cache:        859       3143 Swap:          255         26        229   EDIT: df -i  Filesystem      Inodes   IUsed  IFree IUse% Mounted on /dev/xvda      2872640 1878464 994176   66% / devtmpfs        512053    1388 510665    1% /dev none            512347     775 511572    1% /run none            512347       1 512346    1% /run/lock none            512347       1 512346    1% /run/shm   df -T  Filesystem     Type     1K-blocks     Used Available Use% Mounted on /dev/xvda      ext4      49315312 11447636  37350680  24% / devtmpfs       devtmpfs   2048212        4   2048208   1% /dev none           tmpfs       409880      164    409716   1% /run none           tmpfs         5120        0      5120   0% /run/lock none           tmpfs      2049388        0   2049388   0% /run/shm   EDIT: I increased the number of inodes, and reduced the depth of my directories, and it seemed to work. It took 2m16seconds this time round.