I have installed CYGWIN on a 2008R2 server and have some disks which I have mounted to folders as below (example):
l:\mounted\mounted_hd1
l:\mounted\mounted_hd2
l:\mounted\mounted_hd3
I have data and additional folders under the mountpoints (example):
l:\mounted\mounted_hd1\photos
l:\mounted\mounted_hd2\backup_data
l:\mounted\mounted_hd3\data
When I run the following command: C:\cygwin\bin\df -k /cydrive/L/mounted/mounted_hd1
I get the following:
/usr/bin/df: cannot stat '..': No such file or directory
/usr/bin/df: no file systems processed
However, when I run C:\cygwin\bin\df -k /cydrive/L/mounted
I get the size of the disk L: which was created for mounting the disks...
Why am I not able to run df -k on the mounted folders?
Thanks for your help!
As far as I tell, in the x86 version of Cygwin , the df -k command for determining disk usage is not able to properly run against child folders for disks mounted as folders in disk management.
I was able to resolve my issue by updating Cygwin to the x64 version:
Determine the version of Cygwin installed - via cmd - run:
uname -a
The x86 version will contain: i686
The x64 version will contain: x86_64
If you require the above functionality as I did in my specific use-case , then install the latest x64 version needed as required:
https://cygwin.com/
Related
Trying to install Julia on a machine with the following specification:
Operating System: Ubuntu 18.04.6 LTS
Kernel: Linux 5.4.0-1090-azure
Architecture: x86-64
I ran:
tar -xvzf julia-1.6.7-linux-x86_64.tar.gz
and got several error messages that look like these:
julia-1.6.7/lib/libjulia.so
tar: julia-1.6.7/lib/libjulia.so: cannot create symlink to ‘libjulia.so.1.6’: operation not supported
julia-1.6.7/lib/julia/libgfortran.so
tar: julia-1.6.7/lib/julia/libgfortran.so: Cannot create symlink to ‘libgfortran.so.4.0.0’: Operation not supported
Any suggestion on how to solve these error messages are much appreciated.
The typical problem is that not all operating systems are supporting symlinks.
Try df -Th and look what is going on with the drive you are trying to install:
root#LGPSZ:~# df -Th
Filesystem Type Size Used Avail Use% Mounted on
...
/dev/sdc ext4 1007G 8.0G 948G 1% /
...
In the example above my root drive is an ext4 type which supports symlinks.
On the other hand a Windows file system could be mounted on your Linux machine which type is denoted as ntfs or vfat. Those file system do not support symbolic links and hence the tar command will fail.
P.S.
[ugly workaround for desperate cases] If you really need to use ntfs partition on a Linux system a brutal workaround could be untarring the file on an ext4 file system and then tarring it again using --deference option - in that case you would get a tar archive without symlniks (I have not tested it with Julia though but should work).
I am trying to setup a script that will:
Connect to a windows share
Using LOAD DATA LOCAL INFILE, upload the two files into their appropriate db tables
Umount share
Situation:
I can currently vpnc into this remote machine
Problem:
I cannot
mount -t cifs //ip.address/share /mnt/point -o username=u,password=p,port=445
mount error(110) Connection timed out
I am attempting to do this manually first
Remote server is open to port 445
Questions:
Do I even need to vpnc in first?
Do I need to do route add for the remote ip/mask/gw after vpnc?
Thank you!
The mount.cifs file is provided by the samba-client package. This can be installed from the standard CentOS yum repository by running the following command:
yum install samba samba-client cifs-utils
Once installed, you can mount a Windows SMB share on your CentOS server by running the following command:
Syntax:
mount.cifs //SERVER_ADDRESS/SHARE_NAME MOUNT_POINT -o user=USERNAME
SERVER_ADDRESS: Windows system’s IP address or hostname
SHARE_NAME: The name of the shared folder configured on the Windows system
USERNAME: Windows user that has access to this share
MOUNT_POINT: The local mount point on your CentOS server
I am mounting to a share from \\10.11.10.26\snaps
Make a directory under mount for your reference
mkdir /mnt/mymount
Now I am mounting the snaps folder from indiafps02, User name is the Domain credentials, i.e. Mydomain in this case
mount.cifs //10.11.10.26/snaps /mnt/mymount -o user=Girish.KG
Now you could see the content by typing
ls /mnt/mymount
So, after performing your task, just fire umount command
umount /mnt/mymount
That's it. You are done.
no need to install "samba" and "samba-client", only "cifs-utils" using command
yum install cifs-utils
after that in windows share the folder you would like to mount in centos if you didn't do that already ("c:\interpub\wwwroot" in my case).
make sure you share it with a specific username whom your know the password for ("netops" in my case).
create a directory in centos in which you would like to mount the windows share in to ("/mnt/cm" in my case).
after that run that simple command as a root
mount.cifs //10.16.0.160/wwwroot /mnt/cm/ -o user=netops
centos will prompt you for the windows username password.
you are done.
I spent a very long time searching for an answer in internet but I
found nothing. I want to add custom rpm to a red hat workstation iso
dvd. I do the following things:
mount a red hat iso (mount -t iso9660
rhel-workstation-6.4-i386-dvd.iso /mnt/iso)
copy all dvd files to a directory including hidden .discinfo and .treeinfo files :
cp -R /mnt/iso/* /tmp/isofiles;
cp/mnt/iso/.discinfo /tmp/isofiles;
cp /mnt/iso/.treeinfo /tmp/isofiles
then I add additionals rpm to the /tmp/isofiles/Packages directory which is a part of the dvd tree
then I rebuild the repo in /tmp/isofiles with the command createrepo (createrepo --update -g comps.xml .)
at last I rebuild the iso with mkisofs and burn it to a dvd. Note that I also have a kickstart file to automate the installation.
The problem is that during the rpm installation step the dvd is
ejected and I have a message that ask me to insert the Red Hat Linux
Entreprise disc 1. I don't understand why. This only appears if I
modified the repository. Can you help me please ?
Is the RedHat version of your system (where your ran createrepo command) same as the version of redhat.iso that you are modifying?
Not sure if its same, but similar issue has been answered here
This is the syntax i have used for RHEL 6, and it works just fine I just add my rpms to the default Server folder
#for a new Boot disk, delete the contents of ~/repodata , this clears out he old rpm lists
#copy cda5429be6f36ce1...-comps-rhel6-Server.xml repodata/comps-rhel6-Server.xml from Official RHEL iso
#run the command below, will create all the needed files
discinfo=`head -1 .discinfo
createrepo -u "media://$discinfo" -g $compdata .
In my fedora x64 system I accidently did removed the "filesystem" package while I was root , by executing this command :
rpm -e filesystem --nodeps
instead of doing this :
yum update filesystem
and unfortunatly the command executed normally and the "filesystem" package was deleted totally .
now the system is refusing to boot up showing this message :
systemd[1] : Failed to execute /bin/sh , giving up : No such file or directory
Now I can't do anything to fix it so any solutions are welcome, because I don't want to reinstall the system .
I am running an x64 Fedora 18 linux on an intel i3 processor.
I ran into the same beast on Fedora 19, after 3 hours I found a quite straight forward solution, what I did was:
Boot from Fedora-Live USB-stick of the same version installed
Mounted root into a local directory (btrfs): mount -o subvol=/root /dev/sda3 /mnt
Downloaded the filesystem package, telling yum it's working and base-directory are at my mountpoint: yum -c /mnt/etc/yum.conf --installroot=/mnt --downloadonly --downloaddir=/~ install filesystem
Since the package filesystem.x.x.x.rpm was gloriously removed by the rpm -e filesystem --nodeps command already, I installed the downloaded filesystem.rpm - at least I thought so. Turned out I had to force rpm because some other package from Google-Earth was blocking my command:
rpm -Uvh --root=/mnt ~/filesytem.x.x.x.rpm --force
Finally I edited /etc/selinux/config, I turned it off:
SELINUX=disabled
I'd take the drive out, install it in another system mount it as a secondary drive, and fool around with RPM to install the package in the specified path.
Bear in mind you'll need to manually check all your dependencies are installed too, and that you're building the correct version for Fedora 18.
I guess there might be other ways to do this too, but as long as you have another system you can connect the drive to, this might be the least effort.
I'd boot your broken system off a rescue disk on DVD, CD, USB or what have you. My experience was with Knoppix (a few years back), it was regarded as the best. However, if you don't have that, google "fedora rescue" and download that. See if that can read your hard drive, perhaps allowing you to avoid losing files of value that you had on old system, copy out to some removable media. Or, it may actually diagnose your situation and suggest fixing it for you.
Otherwise, I suspect the least-effort path back to a working system will be to install linux from scratch. The "filesystem" is not a separate package, it pretty much is the linux installation. The kernel is still present and booting, but everything else is gone.
I looked for the ISO mounted it extracted the rpm package filesystem-3.2-10.fc19.x86_64.rpm. I then looked for a live cd, boot into and mounted my former working partition and then run
rpm2cpio /root/filesystem-3.2-10.fc19.x86_64.rpm | cpio -idmv
I'm sure this has been asked before but I have no clue what to search for
I am trying to create a custom Linux image (for the Raspberry Pi) - I am currently manipulating the filesystem of the .img but I've discovered it's not as simple as dropping in the binary :( if only...
What is the accepted way to "pre-install" a package on a disk image where you can only manipulate the filesystem and ideally not run it first? Am I best to boot up, install, and then create the image from that, or is there a way of doing it beforehand in the same way you can change configuration settings etc?
Usually, when I have to change something in a disk image, I do the following:
sudo mount --bind /proc /mnt/disk_image/proc
sudo mount --bind /sys /mnt/disk_image/sys
sudo mount --bind /dev /mnt/disk_image/dev
These action are needed as this folder are create during boot process, mounting them in your system image will emulate a full boot. Then, you can chroot on it safely:
sudo chroot /mnt/disk_image
You're now able to issue commands in the chroot environment:
sudo apt-get install chromium
Of course, change /mnt/disk_image to the path where you have mounted your filesystem. apt-get will only works on Debian based system, change it according to your distribution.
You could find problem connecting to the internet and it can be cause by DNS configuration. The best thing you can do, is to copy your /etc/resolv.conf file in the remote filesystem as this file is usually changed by dhcp and it's empty on chroot environment.
This is the only solution that gives you full access to the command line of the system you're trying to modify.
This is an untested idea:
The dpkg tool, which can install .deb packages, has a --root option which can set a different filesystem than the local / path.
From the man page:
--instdir=dir
Change default installation directory which refers to the
directory where packages are to be installed. instdir is
also the directory passed to chroot(2) before running
package’s installation scripts, which means that the
scripts see instdir as a root directory. (Defaults to /)
--root=dir
Changing root changes instdir to dir and admindir to
dir/var/lib/dpkg.
If you mount your image and pass its mountpoint as --root, it should work.
There are things like the Ubuntu Customization Kit which allow you to create your own version of the distro with your own packages.
Crunchbang even has a utility like this, which is the distro I have personally selected for experimenting with my Pi.