Cannot write to mounted (external) HDD [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have tried mounting my external (usb) HDD, but eventhough the permissions match (between the user and the mounted disk) I cannot write, even as root. I tried mounting using pmount and "normal" mount.
System info:
Linux b2 2.6.39.4-4 #1 Fri Aug 19 14:41:59 CEST 2011 ppc GNU/Linux
User info:
zero#b2:~$ id -a
uid=1001(zero) gid=100(users) groups=100(users),46(plugdev)
pmount test:
zero#b2:~$ pmount /dev/sdb1 HDD
zero#b2:~$ mount
...
/dev/sdb1 on /media/HDD type ntfs (rw,noexec,nosuid,nodev,uid=1001,gid=100,umask=077,nls=utf8)
zero#b2:~$ stat /media/HDD/
File: `/media/HDD/'
Size: 4096 Blocks: 8 IO Block: 512 directory
Device: 811h/2065d Inode: 5 Links: 1
Access: (0700/drwx------) Uid: ( 1001/ zero) Gid: ( 100/ users)
zero#b2:~$ touch /media/HDD/testtouch
touch: cannot touch `/media/HDD/testtouch': Permission denied
I also cannot add any new directories.
Interestingly enough I CAN edit and save existing files (but not copy etc.)
test writing to existing file:
root#b2:/home/zero# mount -t ntfs /dev/sdb1 -o umask=022,gid=100,uid=1001 TEST/
root#b2:/home/zero# mount -l
...
/dev/sdb1 on /home/zero/TEST type ntfs (rw,umask=022,gid=100,uid=1001)
zero#b2:~$ cat TEST/test
zero#b2:~$ echo "writing text" > TEST/test
zero#b2:~$ cat TEST/test
writing text
Any ideas?

Read/write access to NTFS filesystems in the Linux kernel. Use ntfs-3g (FUSE) if you need read/write access.
sudo apt-get install ntfs-3g
sudo mount -t ntfs-3g /dev/sdb1 /media/HDD
sudo touch /media/HDD/I_can_write,_my_friends
NTFS-3G homepage:
http://www.tuxera.com/community/ntfs-3g-download/
More or support of NTFS in Debian:
https://wiki.debian.org/NTFS

Related

PLEASE HELP! I mounted the new HDD to existing folder (where another HDD has been mounted), and all files (in other HDD) have disappeared [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 days ago.
Improve this question
I have recently bought a new 8TB HDD (barracuda) and tried to connect and mount the HDD to ubuntu system.
However, I made some mistakes and accidentally mounted the HDD to existing folder, where another HDD has been mounted.
Specifically,
(Before buying new HDD) I had 1 SSD & 1 HDD (will denote as HDD1 from now on), where
SSD: /dev/sda ==> Mounted on /home/{username}/SSD via
mount /dev/sda /home/{username}/SSD
HDD1: /dev/sdc1 ==> Mounted on /home/{username}/HDD1 via
mount /dev/sdc1 /home/{username}/HDD1
After buying new HDD, I have connected the HDD and
tried to do:
HDD2: /dev/sdb1 ==> Mount on /home/{username}/HDD2
what I have actually done
mount /dev/sdb1 /home/{username}
--> Mounted /dev/sdb1 to /home/{username}
After running this comman, all the files in HDD1 and SSD has been removed, and has been overwritten by HDD2's files.
I have read the post where the files are shadowed if mounted over it, but I am keep getting trouble restoring these files, and can't even find the files via
du -sh *
or
df -h
at root.
Are there any chances of this procedure overwriting the files in HDD1 and SSD? Are there any ways to restore back the files? PLEASE HELP!!!!!
WHAT I HAVE TRIED
1.
sudo -i
sudo umount /home/{username}
but
error: target is busy
came up.
So I have killed all the processes running on /home/{username} via
fuser -ck /home/{username}
Now I am completely locked in a state where I can't open /home/{username}/HDD and only terminal is available.
2.
I have tried df -h after doing (at root user, via sudo -i)
and following messages come up.
df: /home/{username}/SSD: Input/output error
df: /home/{username}/HDD1: Input/output error
Filesystem Size Used Avail Use% Mounted on
udev 63G 0 13G 0% /dev
...
/dev/loop14 56M 56M 0 100% /snap/core18/2697
/dev/sdb1 7.3T 3.5T 3.5T 51% /home/{username}

why "locate" doesn't return all existing files? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I wonder why locate doesn't file all .exe files on my system depsite being up to date:
ebra#him:~$ sudo updatedb
ebra#him:~$ locate *.exe
/home/ebra/a.exe
/home/ebra/Downloads/santa.exe
ebra#him:~$
ebra#him:~$ ls /usr/share/nmap/nselib/data/psexec/nmap_service.exe
/usr/share/nmap/nselib/data/psexec/nmap_service.exe
ebra#him:~$
updatedb.conf:
ebra#him:~$ which updatedb
/usr/bin/updatedb
ebra#him:~$ which locate
/usr/bin/locate
ebra#him:~$ type /usr/bin/updatedb
/usr/bin/updatedb is /usr/bin/updatedb
ebra#him:~$ type /usr/bin/locate
/usr/bin/locate is /usr/bin/locate
ebra#him:~$
ebra#him:~$ cat /etc/updatedb.conf
PRUNE_BIND_MOUNTS="yes"
# PRUNENAMES=".git .bzr .hg .svn"
PRUNEPATHS="/tmp /var/spool /media /var/lib/os-prober /var/lib/ceph /home/.ecryptfs /var/lib/schroot"
PRUNEFS="NFS afs autofs binfmt_misc ceph cgroup cgroup2 cifs coda configfs curlftpfs debugfs devfs devpts devtmpfs ecryptfs ftpfs fuse.ceph fuse.cryfs fuse.encfs fuse.glusterfs fuse.gvfsd-fuse fuse.mfs fuse.rozofs fuse.sshfs fusectl fusesmb hugetlbfs iso9660 lustre lustre_lite mfs mqueue ncpfs nfs nfs4 ocfs ocfs2 proc pstore rpc_pipefs securityfs shfs smbfs sysfs tmpfs tracefs udev udf usbfs"
ebra#him:~$
Since your current (home) directory has a file named a.exe , the shell is expanding *.exe, and you are effectively running the command
$ locate a.exe
Try it either without the asterisk or with an escaped asterisk
$ locate \*.exe

Unable to mount disk to directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm getting this error while mounting disk to directory. Please let me know what should I do ?
[root#ip-172-31-39-36 ec2-user]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 8G 0 disk
└─xvda1 202:1 0 8G 0 part /
xvdf 202:80 0 100G 0 disk
[root#ip-172-31-39-36 ec2-user]# mkdir filesystem
[root#ip-172-31-39-36 ec2-user]# mount /dev/xvdf /filesystem
mount: mount point /filesystem does not exist
[root#ip-172-31-39-36 ec2-user]# ls
filesystem
[root#ip-172-31-39-36 ec2-user]# mount /dev/xvdf /filesystem
mount: mount point /filesystem does not exist
You are creating a directory called filesystem in the current directory and not under root. Either of the following fixes should work:
A. Make the filesystem directory under root
[root#ip-172-31-39-36 ec2-user]# mkdir /filesystem
[root#ip-172-31-39-36 ec2-user]# mount /dev/xvdf /filesystem
B. Use the filesystem directory created under the current directory as mount point
[root#ip-172-31-39-36 ec2-user]# mkdir filesystem
[root#ip-172-31-39-36 ec2-user]# mount /dev/xvdf filesystem

Why can't I save a VI file after entering data? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I am new to linux, when I typed "vi FILE1" I was able to open VI editor. I added some data and I want to save the file and I tried :w but it threw me an error.
"file1" E212: Can't open file for writing
Press ENTER or type command to continue
why I am not able to save it?
The directory in which I am creating file has following permissions:
drwxr-xr-x 4 pentaho pentaho 4096 Mar 12 2013 master
I am logging using root user and password.
Output of mount command :
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sdb1 on /etl type ext4 (rw)
/dev/sdc1 on /oracle type ext4 (rw)
/dev/sdd1 on /export type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
You can also get this error if the directory you are trying to save to does not exist. Even the root user will get this error.
When you log in linux with your common user, you are logged with the user you created, but you are not superuser (you do not have all permissions). To execute a program with root priviliges (and therefore have all permissions), you have to add the command sudo. So you should run: $> sudo vi FILE1. This will ask you for the password and then you use vi normally
If you are facing issue in vi, try to create directory manually and edit the file. May be you don't have access to create directory/file.

create a virtual floppy image without mount? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
There are a lot of posts to show to create a virtual floppy image file as a super user or users can run sudo command. The basic steps are:
create empty 1.44MB image file by dd command
format the image file by mkfs.msdos
mount the image file to some mount point
copy something to the mount point
umount the virtual floppy image file
my question is, in case I am just a common user who cannot run sudo command, how can I follow above steps to create a virtual floppy image and write something in it?
Thanks a lot.
Yes, of course you can do this. Use mtools for the FAT and e2tools or genext2fs for the ext2 filesystems.
$ dd if=/dev/zero of=/tmp/disk1.img count=1440 bs=1k
1440+0 records in
1440+0 records out
1474560 bytes (1.5 MB) copied, 0.00569719 s, 259 MB/s
$ /sbin/mkfs.msdos /tmp/disk1.img
mkfs.msdos 3.0.12 (29 Oct 2011)
$ mdir -i /tmp/disk1.img
Volume in drive : has no label
Volume Serial Number is 9913-BFF6
Directory for ::/
No files
1 457 664 bytes free
$ mcopy -i /tmp/disk1.img /etc/issue.net ::/
$ mdir -i /tmp/disk1.img
Volume in drive : has no label
Volume Serial Number is 9913-BFF6
Directory for ::/
issue net 28 2012-06-26 10:49
1 file 28 bytes
1 457 152 bytes free
And of course, I have no root rights.

Resources