Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
5
votes
1
answers
266
views
How to create partitions on a volume with the root filesystem mounted on the enitre disk
I have a server with the root filesystem `/` mounted on `/dev/sda`, i.e., the entire disk, which has no partitions. This situation makes me uncomfortable, and I would like to partition the disk and put the root filesystem on `/dev/sda1`. I'm not sure if this is possible though, without losing my ent...
I have a server with the root filesystem
/
mounted on /dev/sda
, i.e., the entire disk, which has no partitions. This situation makes me uncomfortable, and I would like to partition the disk and put the root filesystem on /dev/sda1
.
I'm not sure if this is possible though, without losing my entire server, since this is the root filesystem. If I run fdisk /dev/sda
, it lets me create the partition /dev/sda1
over the entire disk, but I'm afraid that this will wipe the disk, so I haven't proceeded with that.
Is there a way to move /
from /dev/sda
to /dev/sda1
without losing everything?
Here's fdisk -l
, edited to remove loop devices:
Disk /dev/sda: 117.19 GiB, 125829120000 bytes, 245760000 sectors
Disk model: QEMU HARDDISK
Disk /dev/sdb: 1000 MiB, 1048576000 bytes, 2048000 sectors
Disk model: QEMU HARDDISK
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 2047999 2045952 999M 82 Linux swap / Solaris
Disk /dev/sdc: 160 GiB, 171798691840 bytes, 335544320 sectors
Disk model: Volume
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 335544319 335542272 160G 83 Linux
Dave_G
(61 rep)
Aug 3, 2025, 10:17 PM
• Last activity: Aug 4, 2025, 02:33 AM
2
votes
1
answers
2500
views
USB Drive sometimes changes the Drive name
I have two USB Drives. I created partitions and formatted them to ext4. Running `fdisk -l` shows that I have /dev/sda1 and /dev/sdb1 Device Boot Start End Sectors Size Id Type /dev/sda1 /dev/sdb1 Then I mounted both on boot by running `sudo nano /etc/fstab` I use Samba to access them from the differ...
I have two USB Drives. I created partitions and formatted them to ext4.
Running
fdisk -l
shows that I have /dev/sda1 and /dev/sdb1
Device Boot Start End Sectors Size Id Type
/dev/sda1
/dev/sdb1
Then I mounted both on boot by running sudo nano /etc/fstab
I use Samba to access them from the different computer and most of the time it is working fine, but sometime I can't access the files via samba and running fdisk -l
shows the the device for my drives changed to for example /dev/sdc1. Sometimes it changes only per one drive and sometimes it changes both.
I have no idea why this is happening. Any help is much appreciated.
Greg
(123 rep)
May 2, 2022, 07:35 AM
• Last activity: Jul 22, 2025, 02:06 PM
1
votes
2
answers
3000
views
New SSD USB drive: fdisk doesn't change partitions and mkfs doesn't change format
I have this portable SSD drive that I am trying to format for use with my Raspberry Pi 3: https://www.amazon.com/gp/product/B00N0V4JG2 In the past I have used this exact product, but the 128GB version, formatted as FAT32 on my OSX machine, and the drive worked with no issues on the Pi. I'm using it...
I have this portable SSD drive that I am trying to format for use with my Raspberry Pi 3: https://www.amazon.com/gp/product/B00N0V4JG2
In the past I have used this exact product, but the 128GB version, formatted as FAT32 on my OSX machine, and the drive worked with no issues on the Pi. I'm using it store the Bitcoin blockchain. Now that the blockchain is too big I'm trying to replace the drive with a 512GB drive, and I am having no luck getting this thing to work!
I first tried the OSX FAT32 format, but that didn't work. So I'm trying to format it with the Pi itself.
Starting off with
fdisk /dev/sda
as sudo su
with USB drive unmounted:
/dev/sda1 2 1000215215 1000215214 477G b W95 FAT32
Then I go through the process of [d]elete, [n]ew, [w]rite:
/dev/sda1 2048 1000215215 1000213168 477G 83 Linux
but even after a partprobe
AND a reboot, fdisk -l
still reports no change:
/dev/sda1 2 1000215215 1000215214 477G b W95 FAT32
... am I doing anything wrong up to this point? I also went forward with mfks.ext4 /dev/sda1
and still don't see anything changing (I can post those logs too...) And when I run fsck
it is a TOTAL BLOODBATH -- which is even more confusing! How can a freshly formatted, brand new file-system have so many errors? Stuff like this (selected examples out of hundreds):
Inode 138789 has a extra size (30700) which is invalid
Inode 138825 has a bad extended attribute block 17929510.
Inode 138877 has compression flag set on filesystem without compression support.
Inode 139153 has a extra size (6956) which is invalid
Finally, when I attach the drive my OSX machine I can format it and use it and it works FINE. So I think the drive is not defective.
pinhead
(73 rep)
Jan 17, 2017, 06:59 PM
• Last activity: Jul 10, 2025, 12:05 AM
2
votes
1
answers
4290
views
Adding brick volume to gluster fails
I created a 2TB volume to increase space on home directory. I created the partition: $ parted /dev/xvdb mklabel gpt $ parted -s /dev/xvdb mkpart primary ext4 1 100% Formatted the partition: $ mkfs.ext4 -I 512 /dev/xvdb1 Added the entry to `/etc/fstab` /dev/xvdb /export/home/brick3 ext4 defaults 0 0...
I created a 2TB volume to increase space on home directory.
I created the partition:
$ parted /dev/xvdb mklabel gpt
$ parted -s /dev/xvdb mkpart primary ext4 1 100%
Formatted the partition:
$ mkfs.ext4 -I 512 /dev/xvdb1
Added the entry to
/etc/fstab
/dev/xvdb /export/home/brick3 ext4 defaults 0 0
Created the mountpoint:
$ mkdir -p /export/home/brick3
$ chmod 0755 /export/home/brick3
Mounted the partition:
$ mount /export/home/brick3
$ mkdir /export/home/brick3/home
$ chmod 0775 /export/home/brick3/home
once I tried to add the new brick to volume thats where I get an error.
$ gluster volume add-brick home :/export/home/brick3/home
volume add-brick: failed Incorrect number of bricks supplied 1 with count 2
Mervyn Clarke
(43 rep)
Jul 11, 2018, 02:37 PM
• Last activity: Jul 2, 2025, 04:03 PM
4
votes
3
answers
497
views
Can’t see partition device after creating GPT partition on 6TB disk
I have a 6TB disk in Debian Linux 12, let's say the disk is `/dev/sdd`. It's just for data; no parts of the OS are on it. Now I’m trying to use it as a normal disk with the full space in a single partition. If I try to create the partition, `fdisk` tells me that the max size with a DOS partition is...
I have a 6TB disk in Debian Linux 12, let's say the disk is
/dev/sdd
. It's just for data; no parts of the OS are on it.
Now I’m trying to use it as a normal disk with the full space in a single partition.
If I try to create the partition, fdisk
tells me that the max size with a DOS partition is 2TB.
If I create that, I get a new device /dev/sdd1
, but the size is limited to 2TB, not what I want.
To have a single 6TB partition, I need to use a GPT partition table instead of DOS.
If I do that, I can create a single partition with fdisk
.
But then I don’t get a device node for the partition (/dev/sdd1
), which I need later for things like formatting.
Any ideas?
**EDIT**
I create the partition that way.
fdisk /dev/sdd
Tells me then:
*The size of this disk is 6 TiB (6597069766656 bytes). DOS partition table format cannot be used on drives for volumes larger than 2199023255040 bytes for 512-byte sectors. Use GUID partition table format (GPT).*
Commands are then:
g
n
w
That creates a GPT partition table and a new partition with full size and writes it down.
chris01
(869 rep)
Jun 27, 2025, 08:42 AM
• Last activity: Jun 27, 2025, 01:04 PM
0
votes
1
answers
5632
views
Debian - Create new partition with fdisk and set size ( Last sector )
please could someone help me with my problem of create new disk partition in Debian ? I'am using Proxmox where I have created a few virtual machines. On one of virtual machines where have installed Linux - Debian I have problem with enough free disk space. So I decied that I created new partion on d...
please could someone help me with my problem of create new disk partition in Debian ?
I'am using Proxmox where I have created a few virtual machines.
On one of virtual machines where have installed Linux - Debian I have problem with enough free disk space.
So I decied that I created new partion on disk just for backup files.
**Step 1.**
I resized disk in Proxmox from 100GB to 250GB
**Step 2.**
I logged in to the Debian where I would want to create new partition for storage backup files . Partition shoud have 70GB
**Step 3.**
I run fdisk to create new partition + I'am attaching screenshot (create-new-partion-fdisk.jpg ) where I mark up few command and option that I select, but I have problem that I can't set size of partition to 70GB (+70G). I when i try it set value "+70G" for "Last Selector" question I get Error "Value out of range"
----------
Please could you help me how I can achieve this the most easy way ? I don't have such experience with Debian so if some kind soul would help me I would be glad for that ! Specific commands would be extremely halpful
Thank you !

Filip Skřivánek
(1 rep)
Jun 26, 2022, 10:04 AM
• Last activity: Jun 25, 2025, 05:07 PM
2
votes
1
answers
2944
views
fdisk warning message: (Extended) Partition does not start on physical sector boundary
When I run `fdisk`, I get a warning message: > Partition table entries are not in disk order Here is an example of the command I'm executing and its output: sudo fdisk -l [sudo] password for phil: Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes...
When I run
fdisk
, I get a warning message:
> Partition table entries are not in disk order
Here is an example of the command I'm executing and its output:
sudo fdisk -l
[sudo] password for phil:
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x6058406e
Device Boot Start End Sectors Size Id Type
/dev/sda1 63 1012094 1012032 494.2M 83 Linux
/dev/sda2 1026048 1348251647 1347225600 642.4G 5 Extended
/dev/sda3 * 1348251648 1953523711 605272064 288.6G 7 HPFS/NTFS/exFAT
/dev/sda5 1244766208 1314039807 69273600 33G 83 Linux
/dev/sda6 1314041856 1348251647 34209792 16.3G 82 Linux swap / Solaris
/dev/sda7 1028096 1244764159 1243736064 593.1G 83 Linux
Partition 2 does not start on physical sector boundary.
Partition table entries are not in disk order.
According to my online research, this warning occurs when the partition's sector doesn't start on the "right sector", as it produces speed penalties when writing. One way to identify this issue is supposedly to check if the sector is divisible by 8; if so, the partition is correct.
The output above, except for the first partition, shows that all the partitions have the first sector divisible by 8, i.e. the Extended Partition 2 and its logical partitions.
Am I correct about that? And if so, why am I receiving this warning?
EDIT
I don't have any encripted partition (neither in linux nor in windows).
The version of fdisk is:
sudo fdisk -version
fdisk from util-linux 2.25.2
user3889486
(121 rep)
Aug 6, 2017, 01:59 AM
• Last activity: Jun 19, 2025, 01:07 AM
2
votes
1
answers
2159
views
Change filesystem type from "Linux" to "Linux root (x86-64)"
I just partitioned a new GUID drive, and accidentally chose "Linux filesystem" (`0FC63DAF-8483-4772-8E79-3D69D8477DE4`) instead "Linux root (x86-64)" (`4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709`) for my root partition. I already downloaded and installed the system. Is it possible to change the partition...
I just partitioned a new GUID drive, and accidentally chose "Linux filesystem" (
0FC63DAF-8483-4772-8E79-3D69D8477DE4
) instead "Linux root (x86-64)" (4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709
) for my root partition. I already downloaded and installed the system. Is it possible to change the partition type without reinstalling/repartitioning?
friederbluemle
(211 rep)
Nov 26, 2019, 07:40 AM
• Last activity: Jun 12, 2025, 02:08 PM
4
votes
3
answers
3801
views
Can't restore/reformat my USB flash drive after moving to GPT
I have 8GB flash memory stick. Sometimes ago I formatted it to be able to install Windows from it. I can't remember what exactly I did but I think I wanted to be able to install Win 7 64-bit to boot in EFI mode. Now I can't reformat it nor in Windows nor in Linux. I tried to convert it to MBR from G...
I have 8GB flash memory stick. Sometimes ago I formatted it to be able to install Windows from it. I can't remember what exactly I did but I think I wanted to be able to install Win 7 64-bit to boot in EFI mode.
Now I can't reformat it nor in Windows nor in Linux.
I tried to convert it to MBR from GPT with
I also tried to rewrite an initial drive area with a test content with
gdisk
by gdisk /dev/sdc
, then w
(to write GPT from memory to the drive as the tool reported "Found invalid GPT and valid MBR; converting MBR to GPT format in memory"). Then gdisk /dev/sdc
again:
# gdisk /dev/sdc
GPT fdisk (gdisk) version 0.8.8
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************
, opened expert tools with x
, z
(to destroy GPT).
Here is the output:
Expert command (? for help): z
About to wipe out GPT on /dev/sdc. Proceed? (Y/N): Y
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Blank out MBR? (Y/N): Y
#
then tried to delete a partition with fdisk
# fdisk /dev/sdc
Command (m for help): p
Disk /dev/sdc: 8086 MB, 8086618112 bytes
249 heads, 62 sectors/track, 1023 cylinders, total 15794176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a07ca
Device Boot Start End Blocks Id System
/dev/sdc1 * 62 15793073 7896506 7 HPFS/NTFS/exFAT
Command (m for help): d
Selected partition 1
Command (m for help): p
Disk /dev/sdc: 8086 MB, 8086618112 bytes
249 heads, 62 sectors/track, 1023 cylinders, total 15794176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a07ca
Device Boot Start End Blocks Id System
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Error closing file
After this I tried to pull out and plug in the stick again but NTFS mount error window appeared each time.

badblocks
sudo badblocks -w -s -o /tmp/usbstick.log /dev/sdc
and with dd
sudo dd if=/dev/zero of=/dev/sdc bs=1024k count=2
but I couldn't reformat it to usable state.
Is there a way I can restore its factory state?
My system: Linux Mint 17.3
**UPDATE**
# blkid
/dev/sdc1: UUID="675599A00CE338FC" TYPE="ntfs"
# usb-devices
T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#= 4 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1307 ProdID=0190 Rev=01.00
S: Manufacturer=USBest Technology
S: Product=USB Mass Storage Device
S: SerialNumber=00000000000004
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=98mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
Carter
(1197 rep)
Mar 12, 2016, 01:37 AM
• Last activity: Jun 9, 2025, 11:09 PM
0
votes
1
answers
8044
views
I have a second hard drive installed in my hardware which I can't access from Debian (not mounted)
I just installed Debian but I had some problem during the installation. I first installed my OS on HDD cause I wanted a dualboot with Windows (which WAS located on the SSD) but I couldn't complete it so I decided to say goodbye to Windows and install Debian it again on SSD. Now in my desktop I can s...
I just installed Debian but I had some problem during the installation.
I first installed my OS on HDD cause I wanted a dualboot with Windows (which WAS located on the SSD) but I couldn't complete it so I decided to say goodbye to Windows and install Debian it again on SSD.
Now in my desktop I can see both hard drives but I can't mount the HDD.
I'll paste some relevant information:
$ sudo fdisk -l
Disk /dev/sdb: 89.4 GiB, 96029466624 bytes, 187557552 sectors
Disk model: KINGSTON RBU-SNS
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x34f08e2e
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 185556991 185554944 88.5G 83 Linux
/dev/sdb2 185559038 187555839 1996802 975M 5 Extended
/dev/sdb5 185559040 187555839 1996800 975M 82 Linux swap / Solaris
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM024 HN-M
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x55786839
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 1951522815 1951520768 930.6G 83 Linux
/dev/sda2 1951524862 1953523711 1998850 976M 5 Extended
/dev/sda5 1951524864 1953523711 1998848 976M 82 Linux swap / Solaris
Partition 2 does not start on physical sector boundary.
The drive I'm trying to access is /dev/sda
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 5.8G 0 5.8G 0% /dev
tmpfs 1.2G 9.4M 1.2G 1% /run
/dev/sdb1 87G 5.4G 77G 7% /
tmpfs 5.9G 60M 5.8G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 5.9G 0 5.9G 0% /sys/fs/cgroup
tmpfs 1.2G 20K 1.2G 1% /run/user/1000
Here's what I tried:
~$ sudo fsck.ext4 -f /dev/sda
e2fsck 1.44.5 (15-Dec-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/sda
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193
or
e2fsck -b 32768
Found a dos partition table in /dev/sda
~$ sudo resize2fs /dev/sda 8193
resize2fs 1.44.5 (15-Dec-2018)
resize2fs: Bad magic number in super-block while trying to open /dev/sda
Couldn't find valid filesystem superblock.
~$ sudo resize2fs /dev/sda 32768
resize2fs 1.44.5 (15-Dec-2018)
resize2fs: Bad magic number in super-block while trying to open /dev/sda
Couldn't find valid filesystem superblock.
inside mount output I fount the other drive infos:
/dev/sdb1 on / type ext4 (rw,relatime,errors=remount-ro)
So I wrote:
sudo mount /dev/sda1 /
And the hard disk icon on my desktop disappeared. After a reboot everything's back as it was, I can see the icon, I can't access the driver.
If I click on the Icon:
**Failed to mount "999 GB Volume"**
**Not authorized to perform operation**
*Please help*
Sara Briccoli
(1 rep)
Mar 9, 2021, 11:06 AM
• Last activity: Jun 9, 2025, 10:04 PM
4
votes
3
answers
2273
views
Merging partitions in Debian
I have recently inherited someone else's problem with a linux server. This is one of those all in one debian based lamp setups. It recently ran out of storage and no one seems to know anything about linux in general here. I have managed to expand the drive in VMWare and created the partition as seen...
I have recently inherited someone else's problem with a linux server. This is one of those all in one debian based lamp setups. It recently ran out of storage and no one seems to know anything about linux in general here. I have managed to expand the drive in VMWare and created the partition as seen in the image below. The challenge is to merge the root partition /dev/sda1 with /dev/sda4.
Note: the Start - End blocks are not back to back and I can't afford much downtime on this server. /dev/sda3 can probably be merged too but not important.
UPDATED: df -h output
UPDATED 2: fdisk -l output



Chappy
(51 rep)
Jan 5, 2018, 03:22 PM
• Last activity: Jun 7, 2025, 04:02 PM
5
votes
1
answers
14865
views
Partition #3 contains a ext4 signature
When i use fdisk to create a new partition i get an error which says ``` Partition #3 contains a ext4 signature Do you want to remove the signature? [Y]es/[N]o: ``` This error is not a problem but i am wondering why this error even comes up when the partition has not even been created with a filesys...
When i use fdisk to create a new partition i get an error which says
Partition #3 contains a ext4 signature
Do you want to remove the signature? [Y]es/[N]o:
This error is not a problem but i am wondering why this error even comes up when the partition has not even been created with a filesystem.
While creating a partition i only had two partitions which were #1 and #2, there was no third partition at all. So how is there already a signature of a ext4 filesystem on the partition?
programmer
(1115 rep)
Jun 30, 2019, 10:48 AM
• Last activity: May 16, 2025, 02:07 AM
2
votes
1
answers
1897
views
How to check integrity to HDD with UDF format
I'm having problem with a USB external drive, which seem to be formatted with UDF and was being used for MAC and Windows (or at least that is what told). When I attached the HDD to my Linux system the next are the `dmesg` entries: [21784.312960] usb 2-1.2: new high-speed USB device number 5 using eh...
I'm having problem with a USB external drive, which seem to be formatted with UDF and was being used for MAC and Windows (or at least that is what told).
When I attached the HDD to my Linux system the next are the
dmesg
entries:
[21784.312960] usb 2-1.2: new high-speed USB device number 5 using ehci-pci
**[21784.406283] usb 2-1.2: New USB device found, idVendor=1058, idProduct=1023**
[21784.406291] usb 2-1.2: New USB device strings: Mfr=1,Product=2,SerialNumber=3
[21784.406296] usb 2-1.2: Product: Elements 1023
**[21784.406299] usb 2-1.2: Manufacturer: Western Digital**
[21784.406303] usb 2-1.2: SerialNumber:
[21784.406815] scsi8 : usb-storage 2-1.2:1.0
[21785.403470] scsi 8:0:0:0: Direct-Access WD Elements 1023 2005 PQ: 0 ANSI: 4
[21785.404686] sd 8:0:0:0: Attached scsi generic sg2 type 0
[21785.409491] sd 8:0:0:0: [sdb] 1953519616 512-byte logical blocks: (1.00 TB/931 GiB)
[21785.410605] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
[21785.411723] sd 8:0:0:0: [sdb] Asking for cache data failed
[21785.411729] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[21785.413600] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
[21785.414603] sd 8:0:0:0: [sdb] Asking for cache data failed
[21785.414609] sd 8:0:0:0: [sdb] Assuming drive cache: write through
**[21785.449997] sdb: sdb1 **
[21785.452466] sd 8:0:0:0: [sdb] Test WP failed, assume Write Enabled
[21785.453503] sd 8:0:0:0: [sdb] Asking for cache data failed
[21785.453515] sd 8:0:0:0: [sdb] Assuming drive cache: write through
[21785.453524] sd 8:0:0:0: [sdb] Attached SCSI disk
With that information the HDD seem to be OK. However I'm unable to identify the type of partition (some commands from Windows console show is UDF but I can't confirm with Linux counterparts)
Trying to get more information, the fdisk -l
outputs:
Disk /dev/sdb: 1000.2 GB, 1000202043392 bytes
255 heads, 63 sectors/track, 121600 cylinders, total 1953519616 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0bba88f0
Device Boot Start End Blocks Id System
/dev/sdb1 0 1953519615 976759808 5 Extended
fdisk: unable to read /dev/sdb1: Inappropriate ioctl for device
As the partition doesn't mount, tools like testdisk
and fsck
can't work here (well testdisk
and photorec
just freeze trying to read the HDD). And due the size of the disk the badblocks
command takes a lot of time (and is still running).
I can't find many material about the UDF format (and I don't understand why a HDD use it when is ) and neither what to do when is unable to read any partition at all.
Any suggestion?
RFuentess
(21 rep)
Jan 17, 2014, 06:03 AM
• Last activity: May 4, 2025, 11:05 AM
0
votes
1
answers
2137
views
RPI root partition lost PARTUUID and can't boot
So I cloned a RPI sd card so I could run the same system at home and at work. The sd cards were slightly different sizes so after I ran dd I had to run resize2fs and fsck. If I boot the Pi with this I get dropped to an emergency shell and I can mount the root partition and it works. The problem: I n...
So I cloned a RPI sd card so I could run the same system at home and at work. The sd cards were slightly different sizes so after I ran dd I had to run resize2fs and fsck. If I boot the Pi with this I get dropped to an emergency shell and I can mount the root partition and it works.
The problem: I need this to run headless and I cant mount the root partition every time it starts. When the Pi boots it looks for PARTUUID="ceafa322-02". If I could change the pi to boot from the new root UUID or something that would be fine, but I don't know the boot process on one of these. What I have been trying to do is modify the partition with fdisk, but I dont know how an identifier like 0xXXXXXXXX translates to ceafa322-02 as a PARTUUID
What is the best course of action? I can nuke the installment, but I am almost determined at this point.
ZenRen
(31 rep)
May 6, 2020, 08:20 PM
• Last activity: Apr 27, 2025, 05:02 PM
3
votes
1
answers
176
views
How to extend a logical volume mounted on /home directory?
I was given a CentOS 9 Linux distribution server inside a virtual machine to whom I can connect using `ssh` protocol (from command line). I am running `svn checkout` command in order to clone a remote repository, whose size is around 10GB, into my workspace in CentOS `/home/ /my/workspace`, but afte...
I was given a CentOS 9 Linux distribution server inside a virtual machine to whom I can connect using
ssh
protocol (from command line). I am running svn checkout
command in order to clone a remote repository, whose size is around 10GB, into my workspace in CentOS /home//my/workspace
, but after some time I get:
> No space left on device
And the procedure fails.
If I run df -h
command I get:
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 7.7G 0 7.7G 0% /dev/shm
tmpfs 3.1G 1.4M 3.1G 1% /run
efivarfs 256K 31K 221K 13% /sys/firmware/efi/efivars
/dev/mapper/cs-root 9.4G 1.1G 8.4G 11% /
/dev/mapper/cs-usr 7.5G 5.0G 2.5G 67% /usr
tmpfs 1.0G 0 1.0G 0% /tmp
/dev/mapper/cs-var 7.5G 949M 6.6G 13% /var
/dev/sda2 947M 507M 441M 54% /boot
/dev/mapper/cs-var_tmp 1.9G 46M 1.9G 3% /var/tmp
/dev/mapper/cs-opt 7.5G 112M 7.4G 2% /opt
/dev/sda1 571M 7.5M 564M 2% /boot/efi
/dev/mapper/cs-home 7.5G 7.5G 20K 100% /home
/dev/mapper/cs-var_log 3.8G 584M 3.2G 16% /var/log
/dev/mapper/cs-var_log_audit 3.8G 3.3G 524M 87% /var/log/audit
tmpfs 1.6G 28K 1.6G 1% /run/user/974
tmpfs 1.6G 28K 1.6G 1% /run/user/582851889
And, as you can see, /home
directory is full at 100%
(Size
is 7.5G, Used
is 7.5G, Avail
is 20K).
How can I increase the space available to make the svn checkout
command successful?
Also, the output of lsblk
command is:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 1T 0 disk
├─sda1 8:1 0 572M 0 part /boot/efi
├─sda2 8:2 0 953M 0 part /boot
├─sda3 8:3 0 54.2G 0 part
│ ├─cs-root 253:0 0 9.3G 0 lvm /
│ ├─cs-swap 253:1 0 3.7G 0 lvm [SWAP]
│ ├─cs-usr 253:2 0 7.5G 0 lvm /usr
│ ├─cs-opt 253:3 0 7.5G 0 lvm /opt
│ ├─cs-home 253:4 0 7.5G 0 lvm /home
│ ├─cs-var_log_audit 253:5 0 3.7G 0 lvm /var/log/audit
│ ├─cs-var 253:6 0 7.5G 0 lvm /var
│ ├─cs-tmp 253:7 0 2G 0 lvm
│ ├─cs-var_log 253:8 0 3.7G 0 lvm /var/log
│ └─cs-var_tmp 253:9 0 1.9G 0 lvm /var/tmp
└─sda4 8:4 0 1M 0 part
sr0 11:0 1 1024M 0 rom
And the output of vgs
command is:
VG #PV #LV #SN Attr VSize VFree
cs 1 10 0 wz--n- {K,B,M,G,...} (space of the partition, in my case I may allocate
+50G). Then change the partition type pressing
t, and then
8e to set the partition type to Linux LVM. Finally, save the changes using
w`
## 2. Create a physical volume (PV)
Create a physical volume:
sudo pvcreate /dev/sda5
Verify the operation using sudo pvs
## 3. Extend the volume group (VG)
Extend the volume group cs
:
sudo vgextend cs /dev/sda5
Verify the operation using sudo vgs
## 4. Extend the logical volume (LV)
Extend the logical volume and resize the file system cs-home
:
sudo lvextend -L + -r /dev/mapper/cs-home
I can use -l +%FREE
instead of -L
. Note the -r
flag to resize underlying filesystem together with the logical volume . Verify the operation using sudo df -h
I do not need to format the file system and mount it since I am _extending an existing_ LV.
Since I am new to Linux administration, does my solution make sense? Should I extend /dev/sda3
partition, instead of creating a new one (i.e., /dev/sda5
)?
tail
(181 rep)
Mar 19, 2025, 09:20 AM
• Last activity: Mar 24, 2025, 08:56 AM
2
votes
2
answers
13480
views
Make parted start next partition after previous one - automatically?
I've inherited a shell script that pipes a list of 'random' characters to `fdisk`. What it is doing is partitioning a disk as follows: Set up the blank disk, partition table etc Create first partition size A Create second partition, size Y, immediately after the first one. Create third partition, si...
I've inherited a shell script that pipes a list of 'random' characters to
fdisk
. What it is doing is partitioning a disk as follows:
Set up the blank disk, partition table etc
Create first partition size A
Create second partition, size Y, immediately after the first one.
Create third partition, size X, immediately after the second one.
And to add to the 'fun', A, Y, and X are calculated and may change depending on the size of the available new disk.
Fdisk will prompt for starting position based on the existing positions and the 'code' just 'hits return' and accepts this.
This code is extremely opaque and I would like to replace it with calls to 'parted --script...
' instead of fdisk
but I can't see that parted has a way to say 'start immediately after the last partition'. It looks like I would have to keep calculating the start position myself.
Am I correct and if so does anyone have a sensible solution for this?
Paul D Smith
(261 rep)
Feb 19, 2018, 10:14 AM
• Last activity: Mar 17, 2025, 01:20 PM
41
votes
6
answers
118234
views
Finding the sector size of a partition
I answered [this question][1], *assuming* that the `*.img` file had a sector size of `512`. How do I query a device, or the image of a device, to find the correct sector size? [1]:https://unix.stackexchange.com/questions/2661/mounting-a-img-file/2662#2662
I answered this question , *assuming* that the
*.img
file had a sector size of 512
.
How do I query a device, or the image of a device, to find the correct sector size?
Stefan
(26020 rep)
Oct 3, 2010, 03:51 PM
• Last activity: Mar 17, 2025, 06:04 AM
2
votes
0
answers
70
views
Partitioning or duplicating corrupted SSD
My SSD died and all its data seems to be inaccessible and my Windows computer won't boot anymore. After going to a local computer store I was told that they could fix it by wiping all the data. I can wipe the drive myself and save 200$. But the only way to recover the information inside would be sen...
My SSD died and all its data seems to be inaccessible and my Windows computer won't boot anymore.
After going to a local computer store I was told that they could fix it by wiping all the data. I can wipe the drive myself and save 200$. But the only way to recover the information inside would be sending the SSD to a laboratory which they estimated would set be back around 500$.
What truly matters to me is the data but I can't afford that lab price now.
Would it be possible for me to backup the corrupted data to an external drive to be able to send that external drive to a lab once I can afford it? That way I could at least use again my computer in the meantime.
Right now I can boot up the computer by using a ubuntu bootable usb as a temporary measure.
After doing some research I tried
fdisk
sudo dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress
To copy the corrupted data to the external drive, but it did not work.
Is there anything I can do or I should start accepting that all the data has been lost?
As an extra info: I cannot install anything apt get
on the computer right now due to WiFi stuff, I could do it I think if I made a more permanent installation of linux and started messing around with the connectivity settings.
Also I remember that about half the SSD was empty, could I force a partition in that half to install linux or keep that half usable?
Thanks!
st30
(21 rep)
Feb 13, 2025, 09:38 AM
0
votes
2
answers
5087
views
Increase I/O size (minimum / optimal)
I have the following query: I want to increase the **I/O size (minimum / optimal)** of the CentOS. By default the value is 512 bytes and I want to increase it to **262144 bytes / 524288 bytes.** Currently executing the `fdisk -l` command I get the following result: WARNING: fdisk GPT support is curr...
I have the following query:
I want to increase the **I/O size (minimum / optimal)** of the CentOS.
By default the value is 512 bytes and I want to increase it to **262144 bytes / 524288 bytes.**
Currently executing the
fdisk -l
command I get the following result:
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt Disk identifier: D9567AE9-EB97-4AD7-BA7B-9A2C0EE06951 # Start End Size Type Name 1 2048 411647 200M EFI System EFI System Partition 2 411648 2508799 1G Microsoft basic 3 2508800 104855551 48,8G Linux LVM Disk /dev/sdb: 42.9 GB, 42949672960 bytes, 83886080 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Identificador del disco: 0x62b5095d Disposit. Inicio Comienzo Fin Bloques Id Sistema /dev/sdb1 2048 83886079 41942016 8e Linux LVM WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion. Disk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: gpt Disk identifier: 98228612-062D-4DDC-9CC6-4B849FA55DAF # Start End Size Type Name 1 2048 41943006 20G Linux filesyste
loredd_
(1 rep)
Jan 12, 2020, 01:28 AM
• Last activity: Feb 3, 2025, 08:29 PM
255
votes
21
answers
1528730
views
mount: wrong fs type, bad option, bad superblock
I added a new hard drive (`/dev/sdb`) to Ubuntu Server 16, ran `parted /dev/sdb mklabel gpt` and `sudo parted /dev/sdb mkpart primary ext4 0G 1074GB`. All went fine. Then I tried to mount the drive mkdir /mnt/storage2 mount /dev/sdb1 /mnt/storage2 It resulted in mount: wrong fs type, bad option, bad...
I added a new hard drive (
/dev/sdb
) to Ubuntu Server 16, ran parted /dev/sdb mklabel gpt
and sudo parted /dev/sdb mkpart primary ext4 0G 1074GB
. All went fine. Then I tried to mount the drive
mkdir /mnt/storage2
mount /dev/sdb1 /mnt/storage2
It resulted in
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
I tried mount -t ext4 /dev/sdb1 /mnt/storage2
with identical outcome. I've done this stuff many times before and have never ran into anything like this. I've already read this https://unix.stackexchange.com/questions/22653/mount-wrong-fs-type-bad-option-bad-superblock-on-dev-sdb-on-centos-6-0 to no avail.
fdisk output regarding the drive
Disk /dev/sdb: 1000 GiB, 1073741824000 bytes, 2097152000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0E136427-03AF-48E2-B56B-A467E991629F
Device Start End Sectors Size Type
/dev/sdb1 2048 2097149951 2097147904 1000G Linux filesystem
Eli Korvigo
(2673 rep)
Oct 7, 2016, 10:50 PM
• Last activity: Jan 16, 2025, 03:16 PM
Showing page 1 of 20 total questions