I have 2 drives connected to the server both are 500GB.
drive 1 =/dev/sdc
drive 2 =/dev/sdb
I've partitioned the second drive /dev/sdb in 2 partitions having /dev/sdb1 & /dev/sdb2
What I was looking for is to mount 2 drives on one directory which is /home.
So I did this mount function
mount -l /dev/sdb /mnt/sdb
mount -l /dev/sdc1 /mnt/sdc1
mount -l /dev/sdc2 /backup
then mhddfs /mnt/sdb,/mnt/sdc1 /home -o allow_other
So 2 partitions are mounted to /home
And added this to /etc/ftab
/dev/sdb /mnt/sdb ext3 usrjquota=quota.user,jqfmt=vfsv0 1 1
/dev/sdc1 /mnt/sdc1 ext3 usrjquota=quota.user,jqfmt=vfsv0 1 1
/dev/sdc2 /backup ext4 usrjquota=quota.user,jqfmt=vfsv0 1 1
mhddfs#/mnt/sdb,/mnt/sdc1 /home fuse logfile=/var/log/mhddfs.log defaults,allow_other 0 0
My problem
first of all when reboot server the mhddfs is not automounted so I need to run the command manually through ssh "mhddfs /mnt/sdb,/mnt/sdc1 /home -o allow_other"
And sometimes when huge files are uploaded to /home directory it gets disconnected give this error message "`/home': Transport endpoint is not connected" so I have to umount and remount /home to resolve the problem.
Can you help me know what's wrong with my steps and what to do to resolve both problems.
I had the same issue. I wanted to extend my /home folder on my server by adding a second drive and chose to use mhddfs. I already had a whole harddrive entirely dedicated to my /home, the system being hosted on a separate drive - this has made things easier.
Here is how I proceeded, after my new harddisk was set up and formated:
I created two new mount points: /mnt/home1 and /mnt/home2
I edited /etc/fstab file to :
change my older harddisk moint point from /home to /mnt/home1
Set up my new harddisk mount point on /mnt/home2
Told mhddfs to merge /mnt/home1 and /mnt/home2 into /home
Here is the result in my etc/fstab:
UUID=f29aa9e5-5988-4603-9ecd-5c24dd804d94 /mnt/home1 ext4 defaults 0 2
UUID=e535c3fc-0842-4557-be85-55277912a058 /mnt/home2 ext4 defaults 0 2
mhddfs#/mnt/home1,/mnt/home2 /home fuse defaults,allow_other 0 0
Of course, you have to follow all these steps without restarting the machine (otherwise you will have no more /home directory).
It works pretty well. My older harddrive is now almost 100% full and my system began to write on the newer one, but practicaly speaking you don't even notice it. Everthing you see is a "normal" /home folder and mhddfs coordinates this in a totally transparent way.
I have tried with forcing fsck disk check on startup to make sure everything was ok - I set up the last parameter for mhddfs on /etc/fstab to "0" to make sure fsck does not create problem. Everything runs well, it seems pretty stable.
Related
I created a mount point in an existing setup with this command:
mount -o loop /comptel
and made an entry to /etc/fstab as well which looks like this:
#tmpfs /comptel tmpfs defaults,loop,size=110,mode=1777,dev,exec,suid 0 0
tmpfs /comptel tmpfs rw,nosuid,nodev,size=110,noatime,user,uid=1000,gid=1001,mode=1777 0 0
This looks in df -kh like this:
tmpfs 4.0K 0 4.0K 0% /comptel
But when i reboot the setup, contents from /comptel gets deleted.
Can someone please help me with this issue? What am i doing wrong here?
You could be making a typo or some mistake in /etc/fstab
Steps to mount a disk permanently.
Doing this will mount your disk during boot time.
Attach your disk manually once.
Goto /proc/mounts or /etc/mtab and look for your mount entry.
Copy the entry that you want to be mounted on boot.
Paste it at the end of /etc/fstab. /etc/fstab Contains entries that are mounted during boot.
You can even manually add your entry in /etc/fstab, but copying it from /proc/mounts or /etc/mtab makes sure that you not make any error or mistake in listing your mount point
more helpful links link 1 link 2
I need to move 90 million files from a NFS folder to a second NFS folder, both connections to NFS folder are using same eth0, which is 1Gb/s to the NFS servers, Sync is not needed, only move (overwrite if it exists). I think my main problem is the number of files, not the total size. The best way should be the way with less system calls per file to the NFS folders.
I tried cp, rsync, and finally http://moo.nac.uci.edu/~hjm/parsync/ parsync first took 10 hours in generate 12 GB gzip of the file list, after it took 40 hours and no one file was copied, it was working to 10 threads until I canceled it and started debugging, I found it is doing a call (stat ?) again to each file (from the list) with the -vvv option (it uses rsync):
[sender] make_file(accounts/hostingfacil/snap.2017-01-07.041721/hostingfacil/homedir/public_html/members/vendor/composer/62ebc48e/vendor/whmcs/whmcs-foundation/lib/Domains/DomainLookup/Provider.php,*,0)*
the parsync command is:
time parsync --rsyncopts="-v -v -v" --reusecache --NP=10 --startdir=/nfsbackup/folder1/subfolder2 thefolder /nfsbackup2/folder1/subfolder2
Each rsync has this form:
rsync --bwlimit=1000000 -v -v -v -a --files-from=/root/.parsync/kds-chunk-9 /nfsbackup/folder1/subfolder2 /nfsbackup2/folder1/subfolder2
The NFS folders are mounted:
server:/export/folder/folder /nfsbackup2 nfs auto,noexec,noatime,nolock,bg,intr,tcp,actimeo=1800,nfsvers=3,vers=3 0 0
Any idea how to instruct the rsync to copy the files already in the list from the nfs to the nfs2 folder? Or any way to make this copy efficiently (one system call per file?)
I've had issues doing the same once and I found that it's best to just run a find command and move each file individually.
cd /origin/path
find . | cpio -updm ../destination/
-u command will override the existing files
I am running Neutrino 6.4.0 with an attached standard 2.5" , 250GB Toshiba hard disk with 6 pre-existing qnx6 partitions. All of them can be mounted read-only; however, I cannot mount any of those as read/write. For instance:
mount -r -t qnx6 /dev/hd1t77.3 /home/p3
works fine, while
mount -t qnx6 /dev/hd1t77.3 /home/p3
returns the following:
mount: Can't mount /home/p3 (type qnx6)
mount: Possible reason: Read-only file system
I have even tried different sync options (-o sync=ignore , and -o sync=optional), to no avail.
Interestingly, I have created an additional partition on the same disk using mkqnx6fs /dev/hd1t77.6 , and that partition CAN be mounted read/write
My question is, what might be causing the existing partitions to be read-only, and is there any way to make them read-write?
Your system defines partitions as qnx4 (t77). Probably you should try mount it with qnx4 type. See official help for details.
I have the following in my /etc/fstab file:
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
sv-01:/mnt/UEF/home/user/Videos/complete /home/user/Videos nfs defaults,noauto,user 0 0
and when I issue the command sudo mount -a -v, I get the following output
mount: proc already mounted on /proc
mount: /dev/mmcblk0p1 already mounted on /boot
nothing was mounted
but when I copy paste the above segment of code and issue the below command, the folder mounts perfectly.
sudo mount sv-01:/mnt/UEF/home/user/Videos/complete /home/user/Videos
What could possibly be causing this?
You specified "noauto" parameter for sv-01:/mnt/UEF/home/user/Videos/complete.
From mount manual:
mount -a [-t type] [-O optlist]
(usually given in a bootscript) causes all filesystems mentioned in
fstab (of the proper type and/or having or not having the proper
options) to be mounted as indicated, except for those whose line
contains the noauto keyword. Adding the -F option will make mount
fork, so that the filesystems are mounted simultaneously.
I need to create a chroot jail for my program. The program needs the contents of /dev to execute properly. I don't want to copy the contents of /dev in the chroot jail, because I want to avoid the duplication of elements in the jail.
I have found 2 solutions to this problem, but none of them are fully solving my problem:
Mounting /dev: works, but a sys admin can delete /dev if he deletes the chroot jail through "rm -rf". This is bad...
Symbolic link on /dev: does not work because symbolic links that are pointing outside of the jail do not work.
Do you know a solution that avoids duplication, is secure on deletion and works?
On linux :
You can mount devfs filesystem :
mount -t devtmpfs none /jail/dev
On freebsd :
You can mount devfs filesystem :
mount -t devfs none /jail/dev
Or for mount a folder (not recommended for dev) :
mount_nullfs /dev /jail/dev
If you want no duplication, you need to umount before delete the jail.
You can mount in readonly, but you can have problems with softwares (depends of jail use).