date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,481,306,718,000 |
I am trying to make a photo organizer with a zsh shell script. But i am having trouble creating sub directories within each main directory(based on date). Currently the script starts from a folder i created and gets one argument(the file it needs to edit, hence the first cd $1). Secondly, i do some name changing whic... |
for d in *;
do
cd $d
As far as I can tell this is the error. You've created a loop over your directories d. You cd into $d. But your loop never cd's back out
done
cd ..
done
So on the second iteration with the second $d, you're still in the first subdir, which of course does not contain th... | How can i create sub directories within a directory? [closed] |
1,481,306,718,000 |
I am writing my own rootkit to learn about Linux kernels. I wanted to hook into a syscall and alter the credentials of the current task to be that of roots (i.e.euid=0). I saw you could do this with unused signals when running kill. If you hooked into kill you could grab the signal, check if it matches the one you set... |
The kill command is built into zsh, therefore that is the process involved. mkdir is a separate command.
| why when hooking syscalls from the kernel, is the pid of kill, zsh, but the pid of mkdir is mkdir? |
1,481,306,718,000 |
I want to create a script that creates a new folder with the name of the first argument in the directory specified as the second argument.
#!/bin/bash -e
## Passing Arguments (fastq data and directory where generate the output) into this script
$fastq_file $new_directory
## Create the new directory
mkdir $new_di... |
I hope I understood what you wanted correctly...
#!/bin/bash -e
new_directory=$1
fastq_file=$2
mkdir -p $new_directory/$fastq_file
The script accept two arguments. First is the first directory name, second is the second directory name.
./script 12345 folder2
| Creating a directory from many variables |
1,481,306,718,000 |
Have multiple vm machines that am using for studying, and have come up with this script for copying some files from vm's to my local machine:
SG=rohos; date; for i in `cat /etc/hosts | grep "$SG-" | awk '{print $2}'` ;do echo "Logging into ${i}";ssh -i /root/.ssh/vm_private_key keyless-user@${i} "sudo mkdir -p /tmp/${... |
Your script can't do what you want. As written, it will only ever copy files on remote hosts to /tmp/$SG/$i on the same remote host.
You need to use scp instead of ssh and cp. For example:
SG=rohos
date
for i in $(awk "/$SG-/ {print \$2}" /etc/hosts); do
echo "Logging into $i"
mkdir -p "/tmp/$SG/$i"
scp -i /... | copy files from multiple remote machines to local and create directories for remote machines |
1,481,306,718,000 |
I have a directory that has some subdirectories with files in them. I have another directory that has very similar subdirectories but there may be a few that are added or removed. How can I add and remove subdirectories so the two directories have the same structure?
Is there a simple way to do this using a command o... |
For this answer I used the following tools:
Bash
comm
find
xargs
I recommend you to use the GNU version of the last 3 utilities as they can deal with NUL-delimited records.
First, let's declare some variables. It's necessary to use absolute pathnames in all these variables as we'll be changing directories many times... | How to make sure directory only has specific subdirectories? |
1,481,306,718,000 |
Two slackware 14.2 systems,ssh is 7.9p1.
On local system
mkdir -p -v "I want to create long dir name with spaces"
mkdir: directory 'I want to create long dir name with spaces' created
And is OK
On remote
ssh remote mkdir -p -v "I want to create long dir name with spaces"
mkdir: created directory 'I'
mkdir: created d... |
Solution found
ssh remote mkdir -p -v 'I\ want\ to\ create\ long\ dirname\ with\ spaces'
I don't understand why on remote is different and I have to escape with \.
| Why mkdir with ssh doesn't want create longname dir? [duplicate] |
1,481,306,718,000 |
I have x number of folders
folder1
folder2
folder3
......
folder100
What I want to do is;
add folder2
reorder
So now:
folder1
folder2
folder3
......
folder101
So now, the folder that was folder2 is folder3, and etc.
Example:
folder2 -> folder3, folder3 -> folder4, folder4 -> folder5
The folder1 remain intact.
To be... |
I solved it like this
#!/bin/bash
for f in {100..2} ; do mv $f $((f+1)); done
x="?_1"
y=$(echo $x | cut -b 1-1)
mv $x $y
It's very manual, but solves faster the initial problem.
| Add a folder in a sequence of folders and rename the other folders |
1,481,306,718,000 |
On my CentOS machine, I need to create a main directory inside which I will have a few sub directories and, inside them, some subsubdirectories.
Something like:
main_directory->sub1,sub2,sb3..
sub1->subsub1,subsub2,subsub3..
sub2->subsub1,subsub2,subsub3..
sub3->subsub1,subsub2,subsub3..
I want to create this kind of... |
It is not limited to a fixed number of dirs, so if you want to create 2, 3 or pass your entire life creating directories and sub-directories, until causing a explosion, here is the script:
#!/bin/bash
enter_recursive(){
while true; do
echo "Please enter the name of the directory you want to create inside $PWD... | Sub Directories in sub directory using loop |
1,418,645,106,000 |
I have a pen drive and one partition:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part /
sdb 8:16 1 7.5G 0 disk
└─sdb1 8:17 1 7.5G 0 part
and I have formatted with command:
# mkfs.fat -n A /dev/sdb
and it works fine.
But after then, I... |
Creating a filesystem on a whole disk rather than a partition is possible, but unusual. The documentation only explicitly mentions the partition because that's the most usual case (it does say usually). You can create a filesystem on anything that acts sufficiently like a fixed-size file, i.e. something where if you w... | Is it ok to mkfs without partition number? |
1,418,645,106,000 |
I have just installed Debian 8.4 (Jessie, MATE desktop). For some reason the following command is not recognized:
mkfs.ext4 -L hdd_misha /dev/sdb1
The error I get:
bash: mkfs.ext4: command not found
I have googled and I actually can't seen to find Debian-specific instructions on how to create an ext4 filesystem. Any... |
Do you have /sbin in your path?
Most likely you are trying to run mkfs.ext4 as a normal user.
Unless you've added it yourself (e.g. in ~/.bashrc or /etc/profile etc), root has /sbin and /usr/sbin in $PATH, but normal users don't by default.
Try running it from a root shell (e.g. after sudo -i) or as:
sudo mkfs.ext4 -... | mkfs.ext4 command not found in Debian (Jessie) |
1,418,645,106,000 |
I am wondering what Start and End value to choose when partitioning my ext. SSD using fdisk.
fdisk suggests 2048-250069679, default 2048 but 250069679 cannot be divided by 512 nor by 2048. Wouldn't it be better to set the Start and End value to a number that can be divided by 512 or 2048 or 4096?
For example: Start 40... |
Alignment doesn’t matter for the end sector, at least not for performance reasons. Alignment of the start sector affects all the sectors in the partition; alignment of the last sector only affects the last few sectors of the partition, if at all.
Sectors are numbered from 0; fdisk is suggesting the last sector on your... | How to calculate partition Start End Sector? |
1,418,645,106,000 |
I am creating an empty file...
dd if=/dev/zero of=${SDCARD} bs=1 count=0 seek=$(expr 1024 \* ${SDCARD_SIZE})
...then turning it into an drive image...
parted -s ${SDCARD} mklabel msdos
...and creating partitions on it
parted -s ${SDCARD} unit KiB mkpart primary fat32 ${IMAGE_ROOTFS_ALIGNMENT} $(expr ${IMAGE_ROOTFS_A... |
You want to format a partition in a disk-image file, rather than the entire image file. In that case, you need to use losetup to tell linux to use the image file as a loopback device.
NOTE: losetup requires root privileges, so must be run as root or with sudo. The /dev/loop* devices it uses/creates also require roo... | How to run mkfs on file image partitions without mounting? |
1,418,645,106,000 |
I am partitioning a disk with the intent to have an ext4 filesystem on the partition. I am following a tutorial, which indicates that there are two separate steps where the ext4 filesystem needs to be specified. The first is by parted when creating the partition:
sudo parted -a opt /dev/sda mkpart primary ext4 0% 10... |
A partition can have a type. The partition type is a hint as in "this partition is designated to serve a certain function". Many partition types are associated with certain file-systems, though the association is not always strict or unambiguous. You can expect a partition of type 0x07 to have a Microsoft compatible f... | Why does parted need a filesystem type when creating a partition, and how does its action differ from a utility like mkfs.ext4? |
1,418,645,106,000 |
I have a small "rescue" system (16 MB) that I boot into RAM as ramdisk. The initrd disk that I am preparing needs to be formatted. I think ext4 will do fine, but obviously, it doesn't make any sense to use journal or other advanced ext4 features.
How can I create the most minimal ext4 filesystem?
without journal
with... |
Or you could simply use ext2
For ext4:
mke2fs -t ext4 -O ^has_journal,^uninit_bg,^ext_attr,^huge_file,^64bit [/dev/device or /path/to/file]
man ext4 contains a whole lot of features you can disable (using ^).
| Minimalistic ext4 filesystem without journal and other advanced features |
1,418,645,106,000 |
Will a standard fresh linux (Ubuntu 11.10 to be exact) install and drive re-format (full) successfully TRIM my SSD, or do I need to do something extra?
I know that ext4 will TRIM blocks on erase when I specify the discard option, but I want to start with a completely TRIMmed drive if possible.
|
TRIM is a command that needs to be sent for individual blocks. I have asked the question before (What is the recommended way to empty a SSD?) and it is suggested to use ATA Secure Erase, a command that is sent to the device to clear all data.
| Will formatting my drive TRIM my SSD? |
1,418,645,106,000 |
Formatting xfs volumes on ubuntu 16.04 is extremely slow in our Virtualbox hypervisor, but not vms running inside Nutanix.
Virtualbox
100 GB => seconds
2TB => seconds
Nutanix (HyperConverged)
100 GB => 4 minutes
2TB => 30+ minutes
parted -l -s | grep "Error: * unrecognised disk label"
Error: /dev/sdg: unrecognise... |
This is due to the fact that the hyperconverged hypervisor uses SSD's. The mkfs command formats with NODISCARD (also known as TRIM) by default.
To run mkfs without trim, use the -K option on XFS and -E nodiscard on ext4
XFS
mkfs.xfs -K /dev/sdx
EXT4
mkfs.ext4 -E nodiscard
Warning: Only use -K or -E on new volumes ... | mkfs is extremely slow |
1,418,645,106,000 |
How do I format my external hard drive to a very Linux compatible file system?
|
You could use GUI applications like GParted on Ubuntu.
Install them from the repositories using:
sudo apt-get install gparted
Once you have it installed, select the correct block device/partition and format it using a filesystem like ext2/3/4, JFS, XFS, ResiserFS, etc depending on your needs.
However, the above menti... | Format external hard drive to linux compatible file system |
1,418,645,106,000 |
I need to format a partition.
But I have one LVM on my machine (VirtualBox) that is composed of two different two partitions of two Virtual HDD's (sdb5 and sdc5)
fdisk output
df output
|
LVM doesn't change the way you format a partition. Let's say you would have a volume group called group1 and a logical volume called volume1 then your command should look like this for ext3:
mkfs.ext3 /dev/group1/volume1
In case you don't have any volume groups or logical volumes yet, you have to use the according LV... | How to Format an LVM partition [closed] |
1,418,645,106,000 |
I am trying to format an sdcard following this guide. I am able to successfully create the partition table, but attempting to format the Linux partition with mkfs yields the following output:
mke2fs 1.42.9 (4-Feb-2014)
Discarding device blocks: 4096/1900544
where it appears to hang indefinitely. I have left the p... |
I actually suspect you are being bitten by a much talked ext4 corruption bug in kernel 3 and 4. Have a look at this thread,
http://bugzilla.kernel.org/show_bug.cgi?id=89621
There have been constant reports of corruption bugs with ext4 file systems, with varying setups. Lots of people complaining in forums. The bug se... | Formatting an sdcard with mkfs hangs indefinitely |
1,418,645,106,000 |
How do you make filesystems in OSX? Mac OSX doesn't have the mkfs command.
|
On BSD-derived Unix systems, newfs is more commonly used than mkfs.
Under Mac OS X, you would use newfs_type as the command, where type is one of hfs, msdos, exfat or udf. There are man pages for all of these. As the other answer mentions, you can use diskutil to create filestems but by using the newfs variants you ... | How do you make filesystems in mac OSX |
1,418,645,106,000 |
I've just installed Linux Mint 14. Now I need to format my USB drive, but I'm not getting any option to do that.
How can I do that with a GUI?
|
You can use graphical tools to achieve this, such as GParted. You can install this like so:
apt-get update
apt-get install gparted
Your OS may also include a graphical package manager, if so, you can alternatively install the gparted package from there.
After gparted is installed, run it. Select your flash drive (be ... | How to format USB drive in Linux Mint 14 with GUI? [duplicate] |
1,418,645,106,000 |
How can I format the write protected pendrive?
|
Unless it's write protected with a hardware switch, that shouldn't matter. You will need to be root.
I assume that by 'format' you mean to delete all the files and recreate the file system.
To do this use parted or gparted to create a new partition.
GParted is easy -- it's a graphical application, while parted is f... | How to format a write protected pen drive in Linux? |
1,418,645,106,000 |
My system needs a very high number of inodes on the partition because it is going to store many, many small files. (It's going to be an OSM, OpenStreetMap TileServer running mapnik and tirex).
As far I as learnt the number of inodes of a ext4 partition can only be created when formatting with mkfs.ext4 (see answer he... |
This is supported in the installer. To choose the usage type of a partition created during installation, you need to proceed as follows:
when you get to the partition phase, select “Manual” (you can still have guided partitioning in the manual partitioning tool)
choose the drive you want to partition
confirm you want... | How to increase number of inodes at partitioning during installation of Debian? |
1,418,645,106,000 |
I want to capture all disks that do not have a filesystem ( all disks that mkfs not runs on them )
I tried the below, but still gives the OS ( sda ).
What is the best approach with lsblk or other command to capture all disks that are without filesystem?
lsblk -f | egrep -v "xfs|ext3|ext4"
NAME FSTYPE ... |
lsblk -o NAME,FSTYPE -dsn
This will print a list of block devices that are not themselves holders for partitions (they do not have a partition table). The detected file system type is in the second column. If its blank there is no recognized file system.
So to get the output you want in one command
lsblk -o NAME,FSTY... | How to capture all disks that don’t have a file system |
1,418,645,106,000 |
I'm doing data recovery right now from a disk I've extracted from an old NAS.
It looks like mkfs.ext3 froze on Writing superblocks and filesystem accounting information: since it's more that one hour that I'm waiting for done to appear.
The disk is 2TB SATA connected to USB 3.0, is it normal it takes so long? Is it sa... |
update: From looking at lsusb and dmesg, confirmed that the drive has dropped off the USB bus. So the mkfs has hung. kill -9 on it may stop it and allow the mdraid array to be stopped, or a reboot may be required. If you have to reboot, beware that the system may not reboot cleanly—so it'd be best to sync and unmount/... | mkfs taking too long |
1,418,645,106,000 |
I found a very nice tutorial on how to create virtual hard disks, and I am considering using these for my work in order to store reliably and portably large datasets with associated processing results.
Basically, the tutorial consist in doing this:
dd if=/dev/zero of=MyDrive.vhd bs=1M count=500
mkfs -t ext3 MyDrive.vh... |
There is better alternative than dd to extend a file. The dd command requires several parameters to run properly (to not corrupt your data). I use truncate instead. Despite of its name it can extend the size of a file as well:
truncate - shrink or extend the size of a file to the specified size
-s, --size=SIZE
set or... | Resizing a virtual hard drive |
1,418,645,106,000 |
I want to do a few experiments on the btrfs file system, but I don't want to make any changes to my existing partitions, and I want full control over things like device size.
Is it possible to create a file that looks like a block device that I can mount and unmount, and that will act like a block device such as runni... |
The loop device is what you need for this. Run these commands as root:
truncate -s1G 1GB.img # Sparse allocation of a 1GB file
ld=$(losetup --show --find 1GB.img); echo "$ld"
You will now have a loop device (for example, /dev/loop0) that you can treat as a block device.
mkfs -t btrfs "$ld" # Device that was retur... | Create a file that's treated like a btrfs file system |
1,418,645,106,000 |
we have BBB based custom board with 256MB RAM and 4GB eMMC,
I have partitioned it using below code,
parted --script -a optimal /dev/mmcblk0 \
mklabel gpt \
mkpart primary 128KiB 255KiB \
mkpart primary 256KiB 383KiB \
mkpart primary 384KiB 511KiB \
mkpart primary 1MiB 2MiB \
mkpart primary 2MiB 3MiB \
m... |
As @derobert mentioned in the comment.
mkfs.ext4/mke2fs refers to /etc/mke2fs.conf and formats the partition.
mke2fs chooses block size based on the partition size if not explicitly mentioned. Read -b block-size and -T usage-type in mke2fs man page for the same.
So when partition size is less than 512MB mkfs.ext4 form... | File system block size differs between different ext4 partitions |
1,418,645,106,000 |
I have installed Arch Linux ISO file into Flash disk with the following command:
dd bs=2M if=~/archlinux-2013.11.01-dual.iso of=/dev/sdd
Now I'm trying to format the flash disk with the following command:
sudo mkfs.vfat -F 32 /dev/sdd
But it gets me the following error :
mkfs.vfat: Device partition expected, not m... |
You generally don't want to write the filesystem on the entire block device (ie. /dev/sdd), you want to create a partition and then put the filesystem in there (ie. /dev/sdd1). That is also what your mkfs complained about.
If you are sure you only want to have one filesystem on this disk at a time, and you don't need ... | Problem with formatting Flash Disk |
1,418,645,106,000 |
I have a USB drive which I format with
sudo mkfs.vfat -I /dev/sdb1
When I then look at the size of the USB drive with df -h, it reports its size to be 64 MB, though it should be 8 GB. What am I doing wrong?
fdisk -l /dev/sdb1 gives
Disk /dev/sdb1: 67 MB, 67108864 bytes
241 heads, 62 sectors/track, 8 cylinders, total ... |
It should be mkfs.vfat -I /dev/sdb. sdb1 indicates you probably have more than one partition, and you're just formatting the first one, which happens to be 64MiB.
| Format USB drive |
1,418,645,106,000 |
I ran into this message two days ago=:
tune2fs: Bad magic number in super-block while trying to open /dev/vdc1
Couldn't find valid filesystem superblock.
The system is Ubuntu, a KVM virtual machine under CentOS (host). And I have to add a new XFS file system on a new virtual hard drive.
The new virtual hard drive is ... |
tune2fs applies only to ext[2-4] filesystems; not to XFS ones. The "Bad magic number in super-block" simply means that tune2fs doesn't understand the filesystem type. As you noted, the fact that your filesystem can be mounted confirms that it's viable.
The XFS equivalent of of tune2fs -l is xfs_info.
| Use "tune2fs" on XFS filesystem, get "Couldn't find valid filesystem superblock." |
1,418,645,106,000 |
I'm attempting to install Arch Linux using the btrfs filesystem. I'm at the beginning of the install processes preparing my drive and I'm hitting an issue.
Firstly I begin to clear any GTP and MBR records from any previous installation attempts using:
gdisk /dev/sda
I then go into expert mode using x command and then... |
Using dd we can wipe the partition table. I remember having success with dd while failing with gdisk's zero feature. (Make sure that you have your data backed up).
# dd if=/dev/zero of=/dev/sda bs=512 count=1024
| Error when creating BTRFS Filesystem |
1,418,645,106,000 |
I have a memory stick which I had cleaned of old data fragments.
The memory stick was mounted on /dev/sdc1 so I did:
dd if=/dev/zero of=/dev/sdc1 bs=1M
After the task was complete, my usb memory stick became unrecognized.
What do you do in this case to make the drive recognized again and partition it as FAT?
|
If you want to create a filesystem on your usb stick partition, you should do
mkfs -t vfat /dev/sdc1
as a user who as access rights to write to the partition, like root
| How do you format a USB stick after it is being labled "unrecognised" by Ubuntu? |
1,418,645,106,000 |
I want to make ext2 file system. I want to set "number-of-inodes" option to some number. I tried several values:
if -N 99000 then Inode count: 99552
if -N 3500 then Inode count:
3904
if -N 500 then Inode count: 976
But always my value is not the same. Why?
I call mkfs this way
sudo mkfs -q -t ext2 -F /dev/sda2 -b 40... |
The number hasn't been ignored, it's been rounded up. It looks like space for inodes are allocated in groups. See in your output:
Inodes per group: 1632
When you request 99,000 inodes, that's not divisible by 1,632. So to ensure that you get the number of inodes you requested, the number has been rounded u... | mkfs ext2 ignore number-of-inodes |
1,418,645,106,000 |
I just plugged into USB A 3.0 / C 3.1 my new external HDD to Debian Buster system.
The disk was sold as LaCie 2.5" Porsche Design P'9227 2TB USB-C.
Here is the output of fdisk -l /dev/sdc:
Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: P9227 Slim
Units: sectors of 1 * 512 = 512 bytes... |
A physical sector size of 4096 means that the data on the drive is laid out in units of 4096 bytes, i.e. disk comprised of sequential "compartments" of 4096 bytes, that have to be written atomically. For compatibility reasons, most disks with 4096 byte sectors present themselves as having traditional 512 byte "logical... | Partitioning and formatting a 4k-emulated (512e) HDD |
1,418,645,106,000 |
Formatting a disk for purely large video files, I calculated what I thought was an appropriate bytes-per-inode value, in order to maximise usable disk space.
I was greeted, however, with:
mkfs.ext4: invalid inode ratio [RATIO] (min 1024/max 67108864)
I assume the minimum is derived from what could even theoretically ... |
Because of the way the filesystem is built. It's a bit messy, and by default, you can't even have the ratio as down as 1/64 MB.
From the Ext4 Disk Layout document on kernel.org, we see that the file system internals are tied to the block size (4 kB by default), which controls both the size of a block group, and the am... | Why is 67108864 the maximum bytes-per-inode ratio? Why is there a max? |
1,418,645,106,000 |
mkfs.vfat -c does a simple check for badblocks.badblocks runs multiple passes with different patterns and thus detects intermittent errors that mkfs.vfat -c will not catch.
mkfs.vfat -l filename can read a file with badblocks from badblocks. But I have been unable to find an example on how to generate the file using ... |
From man badblocks:
-o output_file
Write the list of bad blocks to the specified file. Without
this option, badblocks displays the list on its standard output.
The format of this file is suitable for use by the -l option in
e2fsck(8) or mke2fs(8).
So the correct way wo... | Using badblocks with mkfs -l |
1,418,645,106,000 |
Screenshot:
http://imgur.com/DQnhwG2
I'm trying to format an existing ext2 partition as ntfs (or any filesystem) using the mkfs command in Parted, but when I specify the partition to format I get:
parted: invalid token: 1
"1" being the partition number I specified. I'm not sure what's wrong. The goal here is to fi... |
The error message is because it is asking a yes/no question, and "1" is not yes or no. Don't use parted's mkfs command: it is incomplete ( doesn't even support ntfs ), broken, and was removed from parted upstream several releases/years ago beacuse of this. Use mkntfs instead.
| Error "parted: invalid token: 1" When Using Parted To Format A Partition? |
1,418,645,106,000 |
So I have three disks. I had thought to label the volumes themselves:
$ e2label /dev/sda
d80-JD-75MS
$ e2label /dev/sdb
e2label: Bad magic number in super-block while trying to open /dev/sdb
Found a dos partition table in /dev/sdb
$ e2label /dev/sdc
e2label: Bad magic number in super-block while trying to open /dev... |
A label is a property of a filesystem, not of a disk.
You can use e2label to label an extN filesystem (for N={ 2, 3, 4 }). For an FAT filesystem you would need to use fatlabel, mlabel, or another FAT-aware tool.
You seem to have created an extN filesystem on the first disk /dev/sda directly rather than through a parti... | Bad magic number in super-block |
1,418,645,106,000 |
While working on a fresh install of debian on GCP, I am trying to format a disk to xfs.
sudo mkfs -t xfs -n ftype=1 /dev/sdb -f
which gives me this error:
mkfs: failed to execute mkfs.xfs: No such file or directory
Any thoughts? I guess I need to install something but the error does not make it clear what to install... |
I was indeed missing xfsprogs, which upon installing did solve my issue.
So, first install the package:
sudo apt-get install xfsprogs
then:
sudo mkfs -t xfs -n ftype=1 /dev/sdb -f
| Fail to format disk, missing mkfs file. [mkfs: failed to execute mkfs.* : No such file or directory] |
1,418,645,106,000 |
I just bought two new 4TB external USB disks for backups
http://www.bestbuy.com/site/wd-my-passport-4tb-external-usb-3-0-portable-hard-drive-black/5605533.p
that came performatted with a single large ms partition. I'm running slackware 14.2x64, and ran gdisk to d(elete) that partition and make three n(ew) 1.2TB partit... |
The kernel is still using the old partition table.
Issue partprobe for the kernel to use the new partition table or reboot.
See man partprobe for the gory details.
EDIT (thanks to comments):
gdisk prints the following Warning message informing you that the kernel is still using the old partition table, inviting you to... | linux gdisk (on 4TB USB drive) followed my mkfs -- but mkfs doesn't see new partitions |
1,418,645,106,000 |
I need to reformat an SD card back to factory status.
SD card filesystem used for media has become corrupted. Accessing a certain directory causes the filesystem to be remounted readonly, and it cannot be deleted. fsck.vfat says that it does not have a repair method for the specific type of corruption.
|
REMINDER: commands like this are designed to overwrite filesystem data. You must take extreme care to avoid targeting the wrong disk.
EDIT:
Before formatting the card, you may also want to perform a discard operation.
blkdiscard /dev/mmcblk0
This might improve performance - the same as TRIM on a SATA SSD. Resetti... | Reformat SD card |
1,418,645,106,000 |
We have Beaglbone black based custom board with 256MB RAM and 4GB eMMC.
We have script to flash software on the board.
Script erases gpt partition table using following commands
#Delete primary gpt (first 17KiB)
dd if=/dev/zero of=/dev/mmcblk0 bs=1024 count=17
#Delete secondary gpt (last 17KiB)
dd if=/dev/zero of=/dev... |
Thanks to @frostschutz, his suggestion worked for.
Just for completeness I am adding that as an answer,
Using following commands did the trick for me.
wipefs -a /dev/mmcblk0p[0-9]*
wipefs -a /dev/mmcblk0
First command deleted filesystem information from each partitions.
second command deleted partition table.
| How to erase gpt partition table and how to make old partition forget mount information |
1,455,709,058,000 |
I'm installing a CentOS 7 VM, and I would like to create a RAM disk inside the %pre section of a Kickstart file.
However, doing so via
mkfs -q /dev/ram1 8192
is not possible as the mkfs binary is not present in the Kickstart environment, and all other mkfs.* filesystem-specific commands return an error "/dev/ram1: n... |
It turns out that the device node needed to be created with
mknod /dev/ram1 b 1 1
Once this is done, it can be formatted via e.g. mkfs.ext2:
mkfs.ext2 /dev/ram1 8192
| How to create a RAM disk from the Kickstart environment? |
1,455,709,058,000 |
I'm trying to format a supposedly defective hard disk using "mkfs.ext3 -cc /dev/sda1" on a partition that spans over the entire disk.
I wish to understand the meaning of the ongoing error report in mkfs.ext3's command output, on the last line: "...(109/0/0 errors)". I didn't find information about these three values i... |
When all else fails, use the actual sources! There, we see that the fields being printed are:
fprintf(stderr,
_("Pass completed, %u bad blocks found. (%d/%d/%d errors)\n"),
bb_count, num_read_errors, num_write_errors, num_corruption_errors);
In other words, they are the number of read ... | Meaning of "mkfs.ext3 -cc" error report |
1,455,709,058,000 |
I have an 8GB USB storage and lsblk shows it is accessible at /dev/sdb.
When trying to:
sudo mkfs.ntfs -L "label" /dev/sdb
I got:
/dev/sdb is entire device, not just one partition.
Refusing to make a filesystem here!
What to do?
I'm on Ubuntu 18.04.
|
Use the -F option to force mkfs.ntfs to create the file system. See the mkfs.ntfs man page.
| Can't format USB storage at /dev/sdb |
1,455,709,058,000 |
I need to produce a custom live Lubuntu version on a 2GB pendrive. But don't have the pen right now, so I need to test it with the 16GB that I have at hand. The system won't start the live version if this pen is formatted to full capacity (tested on Dell and HP computers), but found that one possible solution is to fo... |
/dev/sdb1 tells me that the drive is partitioned. You will have to repartition the drive so that the first partition is limited to 2 GB or less, and then create the FAT32 file system on this partition.
EDIT: as an alternative solution, you can tell mkdosfs to limit the file system size, instead of using the whole part... | How to format a 16GB pendrive to store only 2GB |
1,455,709,058,000 |
I am trying hard to format a 1GB USB stick so that I can use it to install a new linux OS. Because the Disk utility has failed me when creating the file system. I tried to do it manually using fdisk by going through the following steps to create the master boot record and a 1GB partition:
# fdisk /dev/sdc
Command (m ... |
OK, so in Computer Science, I'm not overly fond of saying "you can't get there from here", but in this case, you're trying to fit a square peg into a round hole.
The Sector size is usually set by the DEVICE. The 2048B sector size reported is normal for a CD/DVD drive, whereas 512B (or 520B -- which is why I said USUAL... | How to format a 1GB USB stick to FAT32 with 512 bytes sector? |
1,455,709,058,000 |
How approximately calc bytes-per-inode for ext2?
I have 7.3GB storage (15320519 sectors 512B each). I have made ext2 filesystem with block size 4096
mke2fs /dev/sda2 -i 524288 -m 0 -L "SSD" -F -b 4096 -U 11111111-2222-3333-4444-555555555555 -O none,filetype,sparse_super,large_file
Filesystem label=SSD
OS type: Linux
... |
Your free space is roughly 7.3*1024*1024*1024 bytes. On average, the size of a file is expected to be 100*1024 bytes. This means you have room for approximately
7.3*1024*1024*1024 / (100*1024) = 7.3*1024*1024/100 ≃ 76,546
distinct files. That implies you need precisely that many inodes.
The mke2fs output indicates yo... | ext2 How to choose bytes/inode ratio |
1,455,709,058,000 |
I am trying to find the creation date on an ext2 file system. I seem to get a current date using dumpe2fs.
The problem is that the original ext2 superblock specification does not contain such information, though it seems like there might be an extension to the original fields (something about after byte 264).In fact u... |
You are correct writing that the original ext2 superblock specification does not make provision for storing the file system creation date.
But leaves 788 bytes Unused starting from offset 236.
Unused meaning free for use by the programs creating/using the filesystem.
Ext4 contrarily makes provision for storing when th... | Unix ext2 superblock - file system creation date |
1,455,709,058,000 |
My SATA HD used as an external disk connected to a USB port is not working. When I try to format it using sudo mkfs.ext4 /dev/sdj1, I get: "Input/output error while writing out and closing file system".
In dmesg, I see
[ 3819.478357] usb 4-3: USB disconnect, device number 47
[ 3819.478535] xhci_hcd 0000:00:14.0: WARN ... |
Could be down to a bad USB cable or/and insufficient/missing external power source. Some USB ports are simply too underpowered to drive a HDD.
| External HDD disconnects when formating. Disk or SATA-to-USB adapter problem? |
1,455,709,058,000 |
What I Did
I attach an HDD, lsblk -S shows this drive as sdc
I use sudo parted /dev/sdc/ to start parted against sdc
I create a partition table as: mklabel gpt
I make a partition: mkpart my-cool-partition and,
select ext2 as my file type
According to man, this actually:
Creates a new partition, without creating a ... |
Depending on where you're going to use that disk: there might be problems - Linux doesn't care, but other OS'es/appliances might.
Years ago I had a box for recording TV that needed an external disk to save the recordings to. The documentation for the box said that it supported using NTFS and VFAT, but the box' own sof... | Why does Parted mkpart ask for file system type, if I can later format with another file system? [duplicate] |
1,455,709,058,000 |
It occurred that I typed -F (--force) instead of -f (--fast) while running mkfs.ntfs command. The USB drive was mounted. What are possible consequences to the drive?
There's also a message "Hope /etc/mtab is incorrect". What does it mean?
|
Essentially what you have done by using mkfs.ntfs -F /dev/sdb or whatever against that flash disk is that you have forced upon the flash disk an ntfs partition.
The alert you are getting and this is just my hunch here is because you mounted it as vfat in /etc/mtab then forced an overwrite of the file system using ntf... | What happens if I format a mounted USB drive with --force flag? |
1,455,709,058,000 |
My system currently has a volume group containing root, swap, and home logical volumes. I would like to reinstall the operating system in the root volume and format the partition in the process. I don't know how logical volumes work so I don't know if there is any information about the volume group that is stored on... |
Unless you want to rebuild your LVM structure, you should not format any partitions. Instead, you should format the logical volumes through the device mapper. Run lsblk. You'll see something like this:
`-sda2 8:2 0 4.5G 0 part
`-VolGroup00-lvolroot 254:0 0 4.5G 0 lvm /
As you ... | Is it safe to reformat an lvm root partition? |
1,455,709,058,000 |
I've successfully created a LUKS drive from a 32Mb USB flash drive. However when I write an ext4 filesystem to it I am unable to mount the result, or even run fsck or dumpe2fs etc.
The drive shows up under lsblk as
sda 8:0 1 31M 0 disk
└─luks 253:0 0 15M 0 crypt
I'm then writing the filesys... |
Sounds like a hardware problem. You should run badblocks in write mode on the device.
Another option would be
to create a small image file (a few 100 MiB)
put a loop device upon it
create the filesystem in it
copy the image file to the (first part of the) device
compare the image file to the respective part of the de... | Unable create ext4 filesystem under LUKS |
1,455,709,058,000 |
We need to create xfs file-system on kafka disk
The special thing about kafka disk is the disk size
kafka disk have 20TB size in our case
I not sure about the following mkfs , but I need advice to understand if the following cli , is good enough to create xfs file system on huge disk ( kafka machine )
DISK=sdb
mkfs... |
From the documentation you cited:
The XFS filesystem [...] does not require any change in the default settings, either at filesystem creation time or at mount.
Source: https://kafka.apache.org/documentation/#xfs
So it should just work. Also there is nothing special anymore about a 20TB device size.
Consider adding a... | What is the right mkfs cli in order to create xfs file-system on huge disk |
1,455,709,058,000 |
I would like to move from an HD to an SSD. Is there anything special to consider here? For example:
Different recommended fstab settings
mkfs or partition tools behaving differently when operating on an HD vs on an SSD -- so I'd end up with a file system optimized for an HD on my SSD.
|
No, not really
Unless you are operating a RAID, no special measures must be taken.
As other answers said, SSDs tend to have a block size of 4k byte instead of 512 byte. For years partition tools are aware of this, hence the partitions are aligned to 1 MiB starts. You can check with fdisk -l /dev/sdx: If the output loo... | Anything special to consider when cloning an HD to an SSD? |
1,455,709,058,000 |
I wanted to install Arch Linux on my Raspberry Pi 3 and I found this tab[Installation] article that describes the process step-by step: Now, I've run into a problem when I tried to create the vfat fs on the first partition:
My partition table:
Command (m for help): p
Disk /dev/mmcblk0p7: 28.4 GiB, 30438064128 bytes, ... |
You are trying to install Arch inside partition 7 of your SD card.
What you have done is to create two partitions inside that one partition. The fdisk utility has assumed that /dev/mmcblk0p7 is the SD Card (whereas it's actually just a partition on the SD Card) and derived the two partition names from it, /dev/mmcblk0... | mkfs.vfat can't find the first partition on my disk |
1,455,709,058,000 |
I'm running Ubuntu 14.10 Server (headless).
I have a group of USB flashdrives that I need to reformat for use across several devices. I've successfully mounted, formatted, copied files to, and unmounted three devices. Upon mounting the forth the system believes that the first partition of this drive has already been m... |
Try umount -f /media/sdb1 or umount -l /media/sdb1.
If all else fails you can manually edit /etc/mtab to remove the offending mount entry.
| System claims my USB is mounted when I insert it and I cannot (un)mount it. How do I fix this? |
1,455,709,058,000 |
I was creating a new file system in my external HDD. While formatting, I had to format this partition to the remaining available partition which is somewhere around 850GB. Now, I created an ext3 file system in this partition. This is the output of my mkfs.ext3 command.
mkfs.ext3 /dev/sdb3
mke2fs 1.41.3 (12-Oct-2008)
... |
First, let us use the bytes notation to understand the concepts. Now, the actual size of the external HDD was 850GB which translates to 912680550400 bytes.
Block size and fragment size
The block size specifies the size that the file-system will use to read and write data. Here the default block size of 4096 bytes is ... | debug mkfs.ext3 command output |
1,455,709,058,000 |
is it possible to capture the UUID number before creating file system on disk?
if yes how - by which command ?
blkid ( before run mkfs.ext4 on sdb disk )
<no output>
blkid ( after run mkfs.ext4 on sdb disk )
/dev/sdb: UUID="9bb52cfa-0070-4824-987f-23dd63efe120" TYPE="ext4"
Goal - we want to capture the UUID num... |
No and yes.
The command to create the filesystem is the one that generates the UUID. So, before running it there is no UUID to use to name the filesystem.
However, it is posible to use an specific UUID to create the filesystem:
$ uuid=$(uuidgen)
$ echo "$uuid"
9a7d78e5-bc6c-4b19-94da-291122af9cf5
$ mkfs.ext4 -U "$uuid... | is it possible to capture the UUID number before creating file system on disk |
1,455,709,058,000 |
is it possible to understand , when filesystem was created on disk ( date and time )
we try the following ( on sdb disk )
tune2fs -l /dev/sdb | grep time
Last mount time: Mon Aug 1 19:17:48 2022
Last write time: Mon Aug 1 19:17:48 2022
but we get only the last mount and last write
what we need ... |
Typically a device /dev/sdb contains a partition table, not a filesystem. It's each individual partition that would contain a filesystem. However, since your example uses /dev/sdb itself I'll also use that here.
Using your own tune2fs command and looking at the output:
tune2fs -l /dev/sdb
it's possible to see by insp... | linux + is it possible to understand when filesystem was created on disk |
1,455,709,058,000 |
we have rhel 7.2 server , server is VM server
and we add new disk - sde
with the following example we create ext file system with label - disk2
mkfs.ext4 -L disk2 /dev/sde
mke2fs 1.42.9 (28-Dec-2013)
/dev/sde is entire device, not just one partition!
Proceed anyway? (y,n) y
Discarding device blocks: done
Filesystem la... |
The labels shown by lsblk (or rather, blkid) in its LABEL column are the file system labels, which are only available on file systems capable of storing a label. A block device with no file system can’t have such a label.
GPT partitions can also be labeled, and lsblk shows that with PARTLABEL. But that’s not an option... | how to create disk label without creation filesystem on new disk |
1,455,709,058,000 |
Considering the output from the ls command:
$ ls -l /sbin/mkfs.ext4
lrwxrwxrwx 1 root root 6 Aug 4 00:10 /sbin/mkfs.ext4 -> mke2fs
$ type mkfs.ext4
mkfs.ext4 is hashed (/sbin/mkfs.ext4)
mkfs.ext4 is a symlink pointing to mke2fs command. Nothing strange, all good and fine. Therefore, running mkfs.ext4is the same as... |
See the parse_fs_type function in mke2fs.c:
if a file system type is specified explicitly (using -t), use that
if the tool is running on the Hurd, use “ext2”;
if the program name is mke3fs, use “ext3”;
if the program name is mke4fs, use “ext4”;
if the program name starts with mkfs., use the suffix;
otherwise, use the... | /sbin/mkfs.fs acts like a binary file even though it's a symbolic link file |
1,455,709,058,000 |
I know I used to be able to do it, and its frustrating I cant recall.
I want to write an ext4 filesystem to a disk image in a folder. I don't want to re-partition my drive, I just need the filesystem to build an OS in.
I tried $mkdir foo then sudo mkfs.ext4 foo 70000
mke2fs 1.45.5 (07-Jan-2020) warning: Unable to get ... |
If you're creating a disk image, you need to operate on a file, not on a directory:
# Create a file of some specific size for the new image
truncate -s 10g disk.img
# Format the image with a new filesystem
mkfs -t ext4 disk.img
You can mount the image using the loop mount option:
mount -o loop disk.img /mnt
Note t... | how do I make a new filesystem image? |
1,455,709,058,000 |
On my machine mkfs.ntfs is slow and results in massive use of resources, preventing me from using the machine for anything else. According to top it (or rather directly related zvol processes) is using 80-90% of every thread available, even threads that were already in use by other processes (such as virtual machines)... |
It should not not take that long for one single case unless you tell it to zeroise the partition and check for bad sectors (and this is the default at least in my version). It is a good idea to check for bad sectors, but you can skip it with the option -f
sudo mkfs.ntfs -f /dev/zd16 -c 8192
| massive resource consumption during mkfs.ntfs on a zvol, why (and how can I limit this)? |
1,455,709,058,000 |
I just installed Linux Mint 17 and when it asked me where to install it I selected the option to overwrite the old Mint 14. Previously I had also windows with NTFS partition of 900GB. Not it is all formatted into ext4 and all the information of almost 800GB is lost.
Please advise what I can do in this situation. It wa... |
Well thanks @krowe. I'm on laptop so can't really use different hard drives. And this particular case was due to misleading information in the installation of Mint 17.
Any way I have found a way to recover all the files i need and will drop a line here what is it all about.
So first i found a live linux usb and star... | How to recover NTFS drive formatted in ext4? |
1,455,709,058,000 |
As the title states, grub is unable to recognise my ext4 partition:
GNU GRUB version 2.06-3~deb11u5
Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists possible
device or file completions.
grub> ls (hd0
Po... |
GRUB2 doesn't currently support the inline_data ext4 feature.
I can't say for sure whether you can disable it at runtime using tune2fs (on an unmounted partition) but you could try.
| grub does not recognise specially-formatted ext4 partition |
1,455,709,058,000 |
size: 58 GB
contents: unknown
device: /dev/sda4
partition type: basic data
When I ran the format, I selected the type which I expected result in type of Linux.
I found a similar issue from 2019, but fdisk wouldn't run the solution.
The file type may be suitable, but I haven't been able to run 'mkdir' on the partition... |
You can't mkdir on a partition.
You need to format (that's not the same as assignment of a partition type) it and mount it first
| /dev/sda4/ on USB stick isn't available after formatting. 'Discs' shows the following: |
1,455,709,058,000 |
I'm using this to wipe a USB flash drive and recreate a FAT filesystem:
dd if=/dev/zero of=/dev/sdb bs=1M #I don't need more advanced wiping
fdisk /dev/sdb
(a few keystrokes to select partition type, etc.)
mkfs.fat /dev/sdb1
The fact that I have to manually do a few keystrokes is annoying. How could I do all of th... |
Here-document syntax allows you to use fdisk non-interactively:
fdisk /dev/sdb <<EOF
n
p
t
b
p
q
EOF
Because this is just an example, I used p and q so no changes are written. Use w after your verified sequence.
Note a blank line corresponds to sole Enter. The point is you can pass your keystrokes this way.
Altern... | Wipe a USB flash drive and recreate a filesystem |
1,454,433,430,000 |
I'm learning C#, so I made a little C# program that says Hello, World!, then compiled it with mono-csc and ran it with mono:
$ mono-csc Hello.cs
$ mono Hello.exe
Hello, World!
I noticed that when I hit TAB in bash, Hello.exe was marked executable. Indeed, it runs by just a shell loading the filename!
Hello.exe is no... |
This is binfmt_misc in action: it allows the kernel to be told how to run binaries it doesn't know about. Look at the contents of /proc/sys/fs/binfmt_misc; among the files you see there, one should explain how to run Mono binaries:
enabled
interpreter /usr/lib/binfmt-support/run-detectors
flags:
offset 0
magic 4d5a
(... | How is Mono magical? |
1,454,433,430,000 |
Currently I don't have a Linux installation with a GUI. All are running text mode. When I do, I usually use KDE. On Windows I am a .NET developer and I haven't done any Mono development, yet. I heard that Monodevelop is only for GNOME.
If you develop Mono on a KDE environment, what IDE do you use?
|
If you're really QT gungho and just can't stand any gtk+ stuff on your desktop, you might be out of luck. If you are, on the other hand, not a library-nazi, may I suggest Monodevelop?
Monodevelop is an IDE primarily designed for C# and other .NET languages. MonoDevelop enables developers to quickly write desktop and... | What IDE do you use for Mono development on KDE? |
1,454,433,430,000 |
I haven't found any concise explanation of this.
|
So you're looking for a package containing a file called System.Windows.Forms.dll. You can search:
on your machine: apt-file search System.Windows.Forms.dll (the apt-file package must be installed)
online: at packages.ubuntu.com.
Both methods lead you to (as of Ubuntu 14.04):
libmono-system-windows-forms4.0-cil and... | How do I install mono's System.Windows.Forms on Ubuntu? |
1,454,433,430,000 |
I am setting up a development server and want to set it up to serve ASP.NET pages using Mono. I am planning on using Cherokee and Mono (http://www.cherokee-project.com/doc/cookbook_mono.html) and wondered if anyone had done any performance testing comparing the Unix based stack to the Windows based.
|
When testing Mono/Linux vs .NET/Windows workloads, you have to remember that there is more at play than just the runtime environment.
There are areas in which Linux performs better than Windows (Most IO and network operations tend to be faster for comparable C programs). At the same time, .NET has a more advanced ga... | Has anyone got any performance numbers comparing IIS and .NET to Cherokee and Mono? |
1,454,433,430,000 |
Without any DE or even X, I want to use ./my.exe to run mono my.exe, like it works with python scripts.
|
Bash has no such feature. Zsh does, you can set up aliases based on extensions:
alias -s exe=mono
This would only work in an interactive shell, however, not when a program invokes another.
Under Linux, you can set up execution of foreign binaries through the binfmt_misc mechanism; see Rolf Bjarne Kvinge. Good Linux d... | How to set bash to run *.exe with mono? |
1,454,433,430,000 |
Why is Resolve-DnsName not recognized for PowerShell Core? So far as I recall it works fine with PowerShell itself.
Is this a .NET versus dotnet problem? That dotnet simply doesn't have this functionality?
thufir@dur:~/powershell/webservicex$
thufir@dur:~/powershell/webservicex$ dotnet --version
2.1.4
thufir@dur:... |
From the What's New In PowerShell Core 6.0 documentation, in the "Backwards Compatibility" section:
Most of the modules that ship as part of Windows (for example,
DnsClient, Hyper-V, NetTCPIP, Storage, etc.) and other Microsoft
products including Azure and Office have not been explicitly ported to
.NET Core yet... | Resolve-DnsName : The term 'Resolve-DnsName' is not recognized as the name of a cmdlet |
1,454,433,430,000 |
I don't have root access to an AIX 5.2 machine and want to run Mono programs in it.
|
Mono does not support AIX.
If you want to try to port Mono to AIX, you would probably want to:
Turn on the manual checking of dereferences in Mono, as AIX keeps the page at address zero mapped, preventing a whole class of errors from being caught. I forget the name of the define, but it was introduced some six mont... | How to install Mono in AIX? |
1,454,433,430,000 |
I want to start working with linux, and I know I should work in that regularly to improve myself.
I work with sql server, office, c# at the company. can I install and do my tasks in linux (i.e. red hat)?
|
You have three options:
1) Emulation (Wine, Crossover Linux, Bordeaux)
2) Virtualization (VMware Player or VMware Workstation, Parallels Desktop, Oracle Virtualbox)
3) Dual Boot
For C# development on Linux, Mono Project is the way to go. You can develop in MonoDevelop IDE and connect to SQL Server hosted in a virtual... | Can I work with Sql Server, Office and C# using Linux? |
1,454,433,430,000 |
My Toshiba Laptop had started running slow recently and, quite frankly, I was tired of Windows 8, so I created a USB of the most recent version of Linux Mint and installed it, moving all my needed projects to GitHub.
I installed MonoDevelop because I know of its tendency for WinForms, but when I try opening the .sln f... |
MonoDevelop 4.2.2 supports Visual Studio 2013 Solutions normally, but you will need change ToolsVersion in your projects. Open each one of the projects in your solution, but open using a text editor your .csproj file and change ToolsVersion="12.0" to ToolsVersion="4.0",
| How to Open Visual Studio 2013 Solution in MonoDevelop |
1,454,433,430,000 |
Does anyone know how to install Mono and MonoDevelop on a Redhat 6.5 Workstation?
I've tried a number of different things but nothing has worked. I tried using git and building with make from the mono website but it didn't build.
|
Most of this comes from http://wiki.phonicuk.com/Installing-Mono-in-CentOS-5-x.ashx
1) Satisfy the dependencies before compiling mono
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
yum install bison gettext glib2 freetype fontconfig libpng libpng-dev... | Install mono and Monodevelop on a new Redhat 6.5 Workstation |
1,454,433,430,000 |
I have a task that runs written in Mono, however sometimes (randomly) the Mono runtime will hang after the task is complete and just print:
_wapi_handle_ref: Attempting to ref unused handle 0x2828
_wapi_handle_unref_full: Attempting to unref unused handle 0x2828
_wapi_handle_ref: Attempting to ref unused handle 0x2828... |
{
my-mono-app 2>&1 >&3 3>&1 | awk '
{print}
/ref unused/ {print "Exiting."; exit(1)}' >&2
} 3>&1
awk would exit as soon as it reads one of those messages, causing my-mono-app to be killed by a SIGPIPE the next time it tries to write something on stderr.
Don't use mawk there which buffers stdin in a stupid ... | Stop a task based on output |
1,454,433,430,000 |
I am using fedora 23 and I want to install .NET framework 4 in wine.
based on here, I have to remove mono first. But when I run the following command I receive unsuccessful result.
$ wine uninstaller --remove '{E45D8920-A758-4088-B6C6-31DBB276992E}'
fixme:ntdll:find_reg_tz_info Can't find matching timezone information... |
Easiest way to install .NET 4.0 is to use the newest Winetricks script:
$ wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
$ sh winetricks dotnet40
Also, if you have 64-bit wine installed, you will need to use newer .NET 4.5 (dotnet45) instead of 4.0.
| How to install wine with .NET framework instead of mono? |
1,454,433,430,000 |
I know I'm running mono-apache-server4 but when I launch the site mono-apache-server2 is responding.
Why is my site not using 4.0?
See htop:
This is what I did:
Installed Debian Wheezy along with apache and mod-mono:
apt-get install mono-apache-server2 mono-apache-server4 libapache2-mod-mono libmono-i18n2.0-cil
The... |
MonoServerPath example.com "/usr/bin/mod-mono-server4"
should probably be
MonoServerPath mydomain.org "/usr/bin/mod-mono-server4"
| apache virtualhost using mono-apache-server2 not mono-apache-server4 |
1,454,433,430,000 |
I tried downloading and running the Paint.NET installer under mono and got:
Cannot open assembly 'Paint.NET.3.5.8.Install.exe':
File does not contain a valid CIL image.
Can this be installed using mono?
If it matters, I'm running Ubuntu.
|
No, Paint.NET will not run on Mono.
There was some (currently abandoned) effort to port it to non-Windows systems.
Also, it has inspired Pinta, a project which is supposed to be drop-in replacement for Paint.NET on non-Windows systems.
| Can I install Paint.Net on linux using mono? |
1,454,433,430,000 |
I would like to run an ASP.net MVC application that requires Mono 4 on Debian Jessie, but Jessie is missing the required package "libapache2-mod-mono" [1]. On [2] I found that the package was removed from Jessie some time ago (2014-01-04), according to [3] because a file named "mono.load" is missing (in Wheezy (stable... |
As hinted by https://packages.qa.debian.org/m/mod-mono/news/20140104T163913Z.html, the problem was https://bugs.debian.org/731374, which is fixed in unstable, in version 3.8-1 as you can see as the end of the bug thread. So if you want to use the unstable version on Jessie, you can. No reason not to.
In case it isn't ... | How to run mod_mono on Debian Jessie (package libapache2-mod-mono missing)? |
1,454,433,430,000 |
I have a BeagleBone Black here,
running Debian 8.3, Linux 4.1.15-ti-rt-r43.
Desktop is LXQT.
After boot, I want to run a .sh file - when the desktop environment is ready, as that file, after changing path and setting some variables, calls mono to start a GUI based program.
Using the "start menu":
Preferences -> LXQt s... |
Okay, it works. I don't have a very precise answer to the exact question of why the autostart did not work other than noting the difference of: .sh file does not work, application directly does work.
What I did now:
After deleting the old .desktop files in autostart folder, I created the one:
$ nano ~/.config/autostar... | Why does LXQT Autostart not do anything? |
1,454,433,430,000 |
The Mono download page has a download for OpenSuse but not any other version of Linux. Why is that, is OpenSuse better suited for Mono for some reason than say Ubuntu?
We're developing on Macs using 3.2.5 and currently deploying to an Ubuntu (12.04) server using Mono 2.10. And notice some differences, especially artif... |
From the page at http://www.go-mono.com/mono-downloads/download.html, it seems like they used to have downloads for other distros for 2.10.x, under "Other", however it is stated that they are supported by their own communities. My guess would be that the third parties packaging Mono 2.10.x for Ubuntu and Debian have n... | Why is Mono 3.x available specifically for OpenSuse and not other Linux (like Ubuntu) |
1,454,433,430,000 |
If I want to run the application monodevelop, I need to chdir to /usr/lib/monodevelop/Bin and then execute ./MonoDevelop.exe. This is the same for all other Mono applications such as banshee, tomboy, etc.
If I attempt to run the Mono applications from another location by simply running monodevelop, or even from their ... |
It looks like you've built and installed monodevelop from source - did you do the same for the dependencies like gtksharp? Since banshee and tomboy are broken, it sounds like you have a dependency shared between the broken programs, and that's an obvious candidate. Do CLI mono apps work?
From the MonoDevelop build doc... | Why do Mono applications only start from their own directory? |
1,454,433,430,000 |
A C# file in mono can be compiled using gmcs command. This will create a hello.exe file.
$ gmcs hello.cs
$ ls
hello.cs hello.exe
$ ./hello.exe
Hello from Mono!
To generate a linux executable, I tried this command, but it generates the error:
$ gmcs /t:exe hello.cs /out:hello
Unhandled Exception: System.ArgumentExce... |
I was very impatient and felt that the package mono-2.0-devel might have mkbundle. So I went ahead and installed mono-2.0-devel which needed only 18 additional packages. When I typed mkb and hit tab, it showed me mkbundle2.
I tried:
$ mkbundle2 -o hello hello.exe --deps
OS is: Linux
Sources: 1 Auto-dependencies: True
... | Generating a Linux executable with Mono with mkbundle |
1,454,433,430,000 |
I have an OpenSuse Linux server and want to run an ASP.net web project. I have installed the apache2 module mod-mono, but when I try to access the ASP web pages it looks as if it is attempting to use .Net 2 when the project is built under .Net 4.
How can I change it to use .Net 4?
|
In mod-mono's configuration file you must set MonoServerPath to mod-mono-server4 as explained here.
| Enable .Net 4 Mono on OpenSuse |
1,454,433,430,000 |
Has anyone got (or can point in the direction of) a nanorc file that contains syntax highlighting for C# and/or ASP.Net?
|
Using the Java example from http://wiki.linuxhelp.net/index.php/Nano_Syntax_Highlighting, you can try to add something like the following into your ~/.nanorc:
syntax "C# source" "\.cs$"
color green "\<(bool|byte|sbyte|char|decimal|double|float|int|uint|long|ulong|new|object|short|ushort|string|base|this|void)\>"
color... | Nano syntax highlighting for C# and/or ASP. Net |
1,454,433,430,000 |
Is there any way to restart ONE web application in mono without having to restart Apache?
Currently I'm doing a sudo service apache2 restart everytime I deploy my .NET web application to mono, but it restarts all my other applications, requiring them ALL to get reloaded into memory at next web request.
|
Enable the mod_mono control panel.
In httpd.conf, add
<Location /mono>
SetHandler mono-ctrl
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
You will need to modify the addresses that can access it in the Allow from line.
Reload httpd and now you can go to http://some.website.domain/mono. You c... | How to restart mono web application without restarting apache? |
1,454,433,430,000 |
I think Mono, and the C# language, are a great, nay, fantastic project.
My question is: how prevalent is Mono in Ubuntu? How much of a penetration is it getting, and what applications run on it?
|
There are a good number of programs that use mono in Ubuntu if you look at the whole repository. In the default install, I believe the following are the only mono apps:
f-spot
gbrainy
tomboy
There may be more, I just made this list from looking at which applications would be removed if I removed libmono*. However, ... | Applications that run on Mono in Ubuntu |
1,454,433,430,000 |
I was installing some packages and during the install of one, the system hung and the package was not installed. But, the package was added to the list of installed packages. So, I restart the system and I try the following:
When I try to remove the package, it doesn't work because it can't find a config file.
When I... |
There are a couple of approaches to try.
The first is to fix /usr/share/cli-common/policy-remove so it doesn’t fail if the policy is absent: edit its last line so that it runs rm -f instead of rm. That should allow the packages to be removed correctly.
If that fails, and since you’re trying to remove all the Mono pack... | Unable to remove CLI library packages |
1,454,433,430,000 |
After I sudo apt-get install mono-devel , when I try to purge mono-devel on Ubuntu Linux 16.04, I get the following error message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible si... |
If you were getting this error on an install operation then a likely cause would be that your local database of available packages doesn't match what's available on the server, so APT is requesting package versions that don't exist anymore. The fix in that case is to run apt-get update to update the local availability... | Why I cannot purge mono-devel on Ubuntu Linux 16.04? |
1,454,433,430,000 |
I am running my donnet framework based application using mono in Linux Ubuntu. My application uses linphone's mediastream command to open the RTP socket and hook the audio device.
I am using the following mediastream command to call from my application:
mediastream (arguments......)
Every thing is working fine but wh... |
Linphone's mediastream require CTRL+C (SIGINT) to close properly and killall default signal is SIGTERM. So you can try SIGINT signal in killall command as follows:
killall -SIGINT mediastream
or
killall -2 mediastream
| Mediastream goes defunct |
1,454,433,430,000 |
I wanted to upgrade my packages on my raspberry pi, so I've successfully done a apt-get upgrade.
After that, I obviously wanted to do an apt-get upgrade but I had an error.
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to corre... |
I encountered the same problem today and this worked for me (I'm running Armbian on a Pine64):
mv /etc/mono/config.dpkg-new /etc/mono/config
followed by
apt install ca-certificates-mono
I got the solution from over here:
| apt --fix-broken install fails |
1,454,433,430,000 |
This is an odd one but I seem to be unable to solve it.
I'm creating a visual user interface to modify internet settings on Debian Wheezy (and other debian versions/derivatives that are incidentally compatible).
I want to be able to modify the DNS on the basis of what the user inserts.
After "Save" is pressed ... |
It looks to me like your code is adding a semicolon to the end of the nameserver line; don't do that.
| Resolv.conf modification breaks DNS [closed] |
1,454,433,430,000 |
I always wondered if running Mono apps will ever be available for Linux by just double clicking on the .exe. Now, in order to have a launcher on GNOME, the best way is to add a new bash file which will do the 'mono myapp.exe' for you.
I remember there were some ideas to have that in Linux long time ago, but nothing re... |
Ubuntu has this by default, AFAIK. For an idea of how this might work, take a look at: binfmt_misc
| Enable running mono apps by double-clicking on the .exe file |
1,454,433,430,000 |
I have installed the latest available Mono from the Mono project repositories (I have also tried installing it from the default system repos) but as soon as I run Wine it asks me about downloading Mono and downloads it if I agree. Why does it need it? Why won't it just use the system Mono instance?
Same things is appl... |
It seems I've found the answer myself: Wine uses a version of Mono built for the Windows platform while the instance of Mono installed in the system is, obviously, built for Linux.
| Why does Wine need to install its own instance of Mono when there already is a fresh version of Mono installed in the system? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.